cleanup/refactoring
Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/f8b67dc4 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/f8b67dc4 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/f8b67dc4 Branch: refs/heads/master Commit: f8b67dc42d9892b59b5afd52e351c4ef11c4d457 Parents: 1665084 Author: randgalt <randg...@apache.org> Authored: Tue Apr 21 18:01:34 2015 -0500 Committer: randgalt <randg...@apache.org> Committed: Tue Apr 21 18:01:34 2015 -0500 ---------------------------------------------------------------------- .../main/java/org/apache/curator/x/discovery/details/Holder.java | 3 ++- .../apache/curator/x/discovery/details/ServiceDiscoveryImpl.java | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/curator/blob/f8b67dc4/curator-x-discovery/src/main/java/org/apache/curator/x/discovery/details/Holder.java ---------------------------------------------------------------------- diff --git a/curator-x-discovery/src/main/java/org/apache/curator/x/discovery/details/Holder.java b/curator-x-discovery/src/main/java/org/apache/curator/x/discovery/details/Holder.java index c126b29..cbc6236 100644 --- a/curator-x-discovery/src/main/java/org/apache/curator/x/discovery/details/Holder.java +++ b/curator-x-discovery/src/main/java/org/apache/curator/x/discovery/details/Holder.java @@ -2,6 +2,7 @@ package org.apache.curator.x.discovery.details; import org.apache.curator.framework.recipes.cache.NodeCache; import org.apache.curator.x.discovery.ServiceInstance; +import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; class Holder<T> @@ -128,7 +129,7 @@ class Holder<T> } } - ReentrantLock getLock() + Lock getLock() { return lock; } http://git-wip-us.apache.org/repos/asf/curator/blob/f8b67dc4/curator-x-discovery/src/main/java/org/apache/curator/x/discovery/details/ServiceDiscoveryImpl.java ---------------------------------------------------------------------- diff --git a/curator-x-discovery/src/main/java/org/apache/curator/x/discovery/details/ServiceDiscoveryImpl.java b/curator-x-discovery/src/main/java/org/apache/curator/x/discovery/details/ServiceDiscoveryImpl.java index f15a387..8e3e1f9 100644 --- a/curator-x-discovery/src/main/java/org/apache/curator/x/discovery/details/ServiceDiscoveryImpl.java +++ b/curator-x-discovery/src/main/java/org/apache/curator/x/discovery/details/ServiceDiscoveryImpl.java @@ -518,8 +518,7 @@ public class ServiceDiscoveryImpl<T> implements ServiceDiscovery<T> { Holder<T> newHolder = new Holder<T>(instance, nodeCache); Holder<T> oldHolder = services.putIfAbsent(instance.getId(), newHolder); - Holder<T> useHolder = (oldHolder != null) ? oldHolder : newHolder; - return useHolder; + return (oldHolder != null) ? oldHolder : newHolder; } private void clean()