Github user paulmillar commented on a diff in the pull request:
https://github.com/apache/zookeeper/pull/430#discussion_r156594153
--- Diff: src/java/main/org/apache/zookeeper/ClientCnxn.java ---
@@ -1232,11 +1233,12 @@ public void run() {
} else if (e instanceof RWServerFoundException) {
LOG.info(e.getMessage());
} else {
+ SocketAddress remoteAddr =
clientCnxnSocket.getRemoteSocketAddress();
LOG.warn(
"Session 0x"
+
Long.toHexString(getSessionId())
+ " for server "
- +
clientCnxnSocket.getRemoteSocketAddress()
+ + (remoteAddr == null ? addr :
remoteAddr)
--- End diff --
I believe that, if `clientCnxnSocket.getRemoteSocketAddress()` is non-null,
the value is always the same as `addr`.
If so, then this could be simplified to just `addr` without the ternary
operation.
---