You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@curator.apache.org by ra...@apache.org on 2014/06/02 18:20:48 UTC

[2/3] git commit: Return null if the connection manager is closed

Return null if the connection manager is closed


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

Branch: refs/heads/curator-rpc
Commit: 30019cda31afee4150bd014d849e5e7677d02909
Parents: bee07a5
Author: randgalt <ra...@apache.org>
Authored: Mon Jun 2 11:20:28 2014 -0500
Committer: randgalt <ra...@apache.org>
Committed: Mon Jun 2 11:20:28 2014 -0500

----------------------------------------------------------------------
 .../org/apache/curator/x/rpc/connections/ConnectionManager.java   | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/30019cda/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/connections/ConnectionManager.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/connections/ConnectionManager.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/connections/ConnectionManager.java
index afcd64e..d644231 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/connections/ConnectionManager.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/connections/ConnectionManager.java
@@ -118,8 +118,7 @@ public class ConnectionManager implements Closeable
 
     public CuratorEntry get(String id)
     {
-        Preconditions.checkState(state.get() == State.STARTED, "Not started");
-        return cache.getIfPresent(id);
+        return (state.get() == State.STARTED) ? cache.getIfPresent(id) : null;
     }
 
     public CuratorEntry remove(String id)