Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZOOKEEPER-4325: Fix bug when list "/" with ZkUtil::listSubTreeBFS #1719

Closed
wants to merge 12 commits into from
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,8 @@ public static List<String> listSubTreeBFS(
String node = queue.poll();
List<String> children = zk.getChildren(node, false);
for (final String child : children) {
final String childPath = node + "/" + child;
// Fix "//some_path" bugs when list "/"
final String childPath = (node.equals("/") ? "" : node) + "/" + child;
queue.add(childPath);
tree.add(childPath);
}
Expand Down Expand Up @@ -290,4 +291,4 @@ public static String aclToString(List<ACL> acls) {
}
return sb.toString();
}
}
}
autumind marked this conversation as resolved.
Show resolved Hide resolved