Repository: zookeeper
Updated Branches:
refs/heads/branch-3.4 997fa5e76 -> 0666919fe
ZOOKEEPER-2978: fix potential null pointer exception when deleting node
At line 518, 'existWatches.remove(clientPath)' is null because watches for clientPath is already
removed.
Author: 07c00h <07c00h@gmail.com>
Reviewers: Abraham Fine <afine@apache.org>
Closes #461 from achimbab/master
(cherry picked from commit f0b67b6e49acec5f022bee25e08f82a29572c97a)
Signed-off-by: Abraham Fine <afine@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/zookeeper/repo
Commit: http://git-wip-us.apache.org/repos/asf/zookeeper/commit/0666919f
Tree: http://git-wip-us.apache.org/repos/asf/zookeeper/tree/0666919f
Diff: http://git-wip-us.apache.org/repos/asf/zookeeper/diff/0666919f
Branch: refs/heads/branch-3.4
Commit: 0666919fe1ecc516276d41337e09163f7cfd4c9a
Parents: 997fa5e
Author: achimbab <07c00h@gmail.com>
Authored: Tue Feb 20 14:38:00 2018 -0800
Committer: Abraham Fine <afine@apache.org>
Committed: Tue Feb 20 14:38:28 2018 -0800
----------------------------------------------------------------------
src/java/main/org/apache/zookeeper/ZooKeeper.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/zookeeper/blob/0666919f/src/java/main/org/apache/zookeeper/ZooKeeper.java
----------------------------------------------------------------------
diff --git a/src/java/main/org/apache/zookeeper/ZooKeeper.java b/src/java/main/org/apache/zookeeper/ZooKeeper.java
index dd23ac8..482e135 100644
--- a/src/java/main/org/apache/zookeeper/ZooKeeper.java
+++ b/src/java/main/org/apache/zookeeper/ZooKeeper.java
@@ -212,7 +212,7 @@ public class ZooKeeper {
synchronized (existWatches) {
Set<Watcher> list = existWatches.remove(clientPath);
if (list != null) {
- addTo(existWatches.remove(clientPath), result);
+ addTo(list, result);
LOG.warn("We are triggering an exists watch for delete! Shouldn't
happen!");
}
}
|