libenchao commented on a change in pull request #7783: 
[FLINK-11699][JobManager] Use equals for String compare in 
AbstractDispatcherResourceManagerComponentFactory
URL: https://github.com/apache/flink/pull/7783#discussion_r258839584
 
 

 ##########
 File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/entrypoint/component/AbstractDispatcherResourceManagerComponentFactory.java
 ##########
 @@ -260,7 +260,7 @@ public AbstractDispatcherResourceManagerComponentFactory(
 
        protected String getHostname(RpcService rpcService) {
                final String rpcServiceAddress = rpcService.getAddress();
-               return rpcServiceAddress == "" ? "localhost" : 
rpcServiceAddress;
+               return "".equals(rpcServiceAddress) ? "localhost" : 
rpcServiceAddress;
 
 Review comment:
   Yes, `RpcService.getAddress` has guaranteed that the return value cannot be 
`null`, hence we can call `isEmpty()` safely.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to