zookeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From af...@apache.org
Subject zookeeper git commit: ZOOKEEPER-2978: fix potential null pointer exception when deleting node
Date Tue, 20 Feb 2018 22:38:22 GMT
Repository: zookeeper
Updated Branches:
  refs/heads/branch-3.5 b3be8a75c -> e40d4050b


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/e40d4050
Tree: http://git-wip-us.apache.org/repos/asf/zookeeper/tree/e40d4050
Diff: http://git-wip-us.apache.org/repos/asf/zookeeper/diff/e40d4050

Branch: refs/heads/branch-3.5
Commit: e40d4050bdc15ddddda19cab0d1c76ad176cbc9b
Parents: b3be8a7
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:16 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/e40d4050/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 b4e6d64..ef1d2a1 100644
--- a/src/java/main/org/apache/zookeeper/ZooKeeper.java
+++ b/src/java/main/org/apache/zookeeper/ZooKeeper.java
@@ -517,7 +517,7 @@ public class ZooKeeper implements AutoCloseable {
                 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!");
                     }
                 }


Mime
View raw message