tisonkun commented on code in PR #1859: URL: https://github.com/apache/zookeeper/pull/1859#discussion_r1125318797
########## zookeeper-server/src/main/java/org/apache/zookeeper/server/watch/WatchManager.java: ########## @@ -232,49 +249,49 @@ public synchronized void dumpWatches(PrintWriter pwriter, boolean byPath) { @Override public synchronized boolean containsWatcher(String path, Watcher watcher) { - WatcherMode watcherMode = watcherModeManager.getWatcherMode(watcher, path); - PathParentIterator pathParentIterator = getPathParentIterator(path); - for (String localPath : pathParentIterator.asIterable()) { - Set<Watcher> watchers = watchTable.get(localPath); - if (!pathParentIterator.atParentPath()) { - if (watchers != null) { - return true; // at the leaf node, all watcher types match - } - } - if (watcherMode.isRecursive()) { - return true; - } - } - return false; + Set<Watcher> list = watchTable.get(path); Review Comment: Thanks for your explanation! I get it now :) -- 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: notifications-unsubscr...@zookeeper.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org