LuJiang created FLINK-37427:
-------------------------------

             Summary: incorrect NPE message in StandaloneHaServices constructor
                 Key: FLINK-37427
                 URL: https://issues.apache.org/jira/browse/FLINK-37427
             Project: Flink
          Issue Type: Improvement
          Components: Runtime / RPC
    Affects Versions: 1.20.0
         Environment: * flink: 1.20.0
            Reporter: LuJiang


The constructor of 
org.apache.flink.runtime.highavailability.nonha.standalone.StandaloneHaServices 
currently uses the variable name clusterRestEndpointAddress instead of the 
string literal "clusterRestEndpointAddress" in the checkNotNull validation for 
the third parameter. This leads to ambiguous NullPointerException messages 
(e.g., NullPointerException: null).

```java

public StandaloneHaServices(
        String resourceManagerAddress,
        String dispatcherAddress,
        String clusterRestEndpointAddress) {
    this.resourceManagerAddress =
            checkNotNull(resourceManagerAddress, "resourceManagerAddress");
    this.dispatcherAddress = checkNotNull(dispatcherAddress, 
"dispatcherAddress");
    this.clusterRestEndpointAddress =
            checkNotNull(clusterRestEndpointAddress, 
clusterRestEndpointAddress);
}

```



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to