zookeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ph...@apache.org
Subject svn commit: r1759835 - in /zookeeper/trunk: CHANGES.txt src/java/main/org/apache/zookeeper/server/util/ConfigUtils.java
Date Thu, 08 Sep 2016 14:21:26 GMT
Author: phunt
Date: Thu Sep  8 14:21:26 2016
New Revision: 1759835

URL: http://svn.apache.org/viewvc?rev=1759835&view=rev
Log:
ZOOKEEPER-2539: Throwing nullpointerException when run the command config -c" when client
port is mentioned as separate and not like new style (Rakesh Kumar Singh via phunt)

Modified:
    zookeeper/trunk/CHANGES.txt
    zookeeper/trunk/src/java/main/org/apache/zookeeper/server/util/ConfigUtils.java

Modified: zookeeper/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/zookeeper/trunk/CHANGES.txt?rev=1759835&r1=1759834&r2=1759835&view=diff
==============================================================================
--- zookeeper/trunk/CHANGES.txt (original)
+++ zookeeper/trunk/CHANGES.txt Thu Sep  8 14:21:26 2016
@@ -370,6 +370,9 @@ BUGFIXES:
   creating temporary file with some junk folder name for
   zookeeper_server.pid (Rakesh Kumar Singh via phunt)
 
+  ZOOKEEPER-2539: Throwing nullpointerException when run the command
+  "config -c" when client port is mentioned as separate and not like
+  new style (Rakesh Kumar Singh via phunt)
 
 IMPROVEMENTS:
   ZOOKEEPER-2024 Major throughput improvement with mixed workloads (Kfir Lev-Ari via shralex)

Modified: zookeeper/trunk/src/java/main/org/apache/zookeeper/server/util/ConfigUtils.java
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/util/ConfigUtils.java?rev=1759835&r1=1759834&r2=1759835&view=diff
==============================================================================
--- zookeeper/trunk/src/java/main/org/apache/zookeeper/server/util/ConfigUtils.java (original)
+++ zookeeper/trunk/src/java/main/org/apache/zookeeper/server/util/ConfigUtils.java Thu Sep
 8 14:21:26 2016
@@ -28,11 +28,11 @@ import org.apache.zookeeper.server.quoru
 
 
 public class ConfigUtils {
-	static public String getClientConfigStr(String configData) {
-        Properties props = new Properties();    	
+    static public String getClientConfigStr(String configData) {
+        Properties props = new Properties();        
         try {
           props.load(new StringReader(configData));
-		} catch (IOException e) {
+        } catch (IOException e) {
             e.printStackTrace();
             return "";
         }
@@ -43,17 +43,20 @@ public class ConfigUtils {
              String key = entry.getKey().toString().trim();
              String value = entry.getValue().toString().trim();
              if (key.equals("version")) version = value;
-             if (!key.startsWith("server.")) continue;	         
+             if (!key.startsWith("server.")) continue;           
              QuorumPeer.QuorumServer qs;
              try {
                qs = new QuorumPeer.QuorumServer(-1, value);
-             } catch (ConfigException e) {				
+             } catch (ConfigException e) {              
                     e.printStackTrace();
                     continue;
              }
              if (!first) sb.append(",");
              else first = false;
-             sb.append(qs.clientAddr.getHostString() + ":" + qs.clientAddr.getPort());
+             if (null != qs.clientAddr) {
+                 sb.append(qs.clientAddr.getHostString()
+                         + ":" + qs.clientAddr.getPort());
+             }
         }
         return version + " " + sb.toString();
     }



Mime
View raw message