You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2019/02/21 09:19:53 UTC

[GitHub] libenchao commented on a change in pull request #7783: [FLINK-11699][JobManager] Use equals for String compare in AbstractDispatcherResourceManagerComponentFactory

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:
users@infra.apache.org


With regards,
Apache Git Services