curator-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From randg...@apache.org
Subject [02/12] git commit: getZooKeeper() should fail if the instance has been closed
Date Wed, 14 May 2014 15:10:51 GMT
getZooKeeper() should fail if the instance has been closed


Project: http://git-wip-us.apache.org/repos/asf/curator/repo
Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/fe54e88f
Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/fe54e88f
Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/fe54e88f

Branch: refs/heads/CURATOR-96
Commit: fe54e88fae32a108b5b11e3f3064a6e76560b867
Parents: 4578b3f
Author: randgalt <randgalt@apache.org>
Authored: Thu Apr 3 10:10:21 2014 -0500
Committer: randgalt <randgalt@apache.org>
Committed: Thu Apr 3 10:10:21 2014 -0500

----------------------------------------------------------------------
 .../src/main/java/org/apache/curator/CuratorZookeeperClient.java   | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/fe54e88f/curator-client/src/main/java/org/apache/curator/CuratorZookeeperClient.java
----------------------------------------------------------------------
diff --git a/curator-client/src/main/java/org/apache/curator/CuratorZookeeperClient.java b/curator-client/src/main/java/org/apache/curator/CuratorZookeeperClient.java
index f0a4ab3..f14214f 100644
--- a/curator-client/src/main/java/org/apache/curator/CuratorZookeeperClient.java
+++ b/curator-client/src/main/java/org/apache/curator/CuratorZookeeperClient.java
@@ -110,6 +110,8 @@ public class CuratorZookeeperClient implements Closeable
      */
     public ZooKeeper getZooKeeper() throws Exception
     {
+        Preconditions.checkState(started.get(), "Client is not started");
+
         return state.getZooKeeper();
     }
 


Mime
View raw message