li4wang commented on code in PR #2321:
URL: https://github.com/apache/zookeeper/pull/2321#discussion_r2636938358


##########
zookeeper-server/src/main/java/org/apache/zookeeper/client/ConnectStringParser.java:
##########
@@ -49,27 +50,71 @@ public final class ConnectStringParser {
      * @throws IllegalArgumentException
      *             for an invalid chroot path.
      */
-    public ConnectStringParser(String connectString) {
-        // parse out chroot, if any
-        int off = connectString.indexOf('/');
-        if (off >= 0) {
-            String chrootPath = connectString.substring(off);
-            // ignore "/" chroot spec, same as null
-            if (chrootPath.length() == 1) {
-                this.chrootPath = null;
-            } else {
-                PathUtils.validatePath(chrootPath);
-                this.chrootPath = chrootPath;
-            }
-            connectString = connectString.substring(0, off);
+    public ConnectStringParser(final String connectString) {
+        if (StringUtils.isBlank(connectString)) {
+            throw new IllegalArgumentException("Connect string cannot be null 
or empty");
+        }
+
+        if (connectString.startsWith(DNS_SRV_PREFIX)) {
+            parseDnsSrvFormat(connectString);

Review Comment:
   updated in https://github.com/apache/zookeeper/pull/2320



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to