curator-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From randg...@apache.org
Subject [40/50] [abbrv] git commit: Return null if the connection manager is closed
Date Sat, 07 Jun 2014 18:19:38 GMT
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/master
Commit: 30019cda31afee4150bd014d849e5e7677d02909
Parents: bee07a5
Author: randgalt <randgalt@apache.org>
Authored: Mon Jun 2 11:20:28 2014 -0500
Committer: randgalt <randgalt@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)


Mime
View raw message