curator-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From randg...@apache.org
Subject curator git commit: clientAddr might be null in which case addr should be used.
Date Fri, 30 Sep 2016 12:43:31 GMT
Repository: curator
Updated Branches:
  refs/heads/CURATOR-3.0 027dee39b -> 199849161


clientAddr might be null in which case addr should be used.


Project: http://git-wip-us.apache.org/repos/asf/curator/repo
Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/19984916
Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/19984916
Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/19984916

Branch: refs/heads/CURATOR-3.0
Commit: 1998491612c2b2658d776b6a71de41ac3d20e0f2
Parents: 027dee3
Author: randgalt <randgalt@apache.org>
Authored: Wed Sep 28 12:10:38 2016 +0200
Committer: randgalt <randgalt@apache.org>
Committed: Wed Sep 28 12:10:38 2016 +0200

----------------------------------------------------------------------
 .../java/org/apache/curator/framework/imps/EnsembleTracker.java | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/19984916/curator-framework/src/main/java/org/apache/curator/framework/imps/EnsembleTracker.java
----------------------------------------------------------------------
diff --git a/curator-framework/src/main/java/org/apache/curator/framework/imps/EnsembleTracker.java
b/curator-framework/src/main/java/org/apache/curator/framework/imps/EnsembleTracker.java
index 2e020d4..efe475e 100644
--- a/curator-framework/src/main/java/org/apache/curator/framework/imps/EnsembleTracker.java
+++ b/curator-framework/src/main/java/org/apache/curator/framework/imps/EnsembleTracker.java
@@ -20,6 +20,7 @@
 package org.apache.curator.framework.imps;
 
 import com.google.common.annotations.VisibleForTesting;
+import com.google.common.base.Objects;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.Maps;
 import org.apache.curator.ensemble.EnsembleProvider;
@@ -41,6 +42,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import java.io.ByteArrayInputStream;
 import java.io.Closeable;
+import java.net.InetSocketAddress;
 import java.util.Arrays;
 import java.util.Properties;
 import java.util.concurrent.atomic.AtomicInteger;
@@ -168,7 +170,8 @@ public class EnsembleTracker implements Closeable, CuratorWatcher
             {
                 sb.append(",");
             }
-            sb.append(server.clientAddr.getAddress().getHostAddress()).append(":").append(server.clientAddr.getPort());
+            InetSocketAddress address = Objects.firstNonNull(server.clientAddr, server.addr);
+            sb.append(address.getAddress().getHostAddress()).append(":").append(address.getPort());
         }
 
         return sb.toString();


Mime
View raw message