Address feedback
Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/c7a1ea0e Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/c7a1ea0e Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/c7a1ea0e Branch: refs/heads/master Commit: c7a1ea0e00a6580fe7c0e0ce4869930b32770ae7 Parents: 180a159 Author: Scott Blum <sco...@squareup.com> Authored: Fri Aug 29 13:55:36 2014 -0400 Committer: Scott Blum <sco...@squareup.com> Committed: Fri Aug 29 13:55:36 2014 -0400 ---------------------------------------------------------------------- .../curator/utils/CloseableExecutorService.java | 2 +- .../curator/framework/recipes/cache/TreeCache.java | 14 +++----------- 2 files changed, 4 insertions(+), 12 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/curator/blob/c7a1ea0e/curator-client/src/main/java/org/apache/curator/utils/CloseableExecutorService.java ---------------------------------------------------------------------- diff --git a/curator-client/src/main/java/org/apache/curator/utils/CloseableExecutorService.java b/curator-client/src/main/java/org/apache/curator/utils/CloseableExecutorService.java index 721754d..6a84bc4 100644 --- a/curator-client/src/main/java/org/apache/curator/utils/CloseableExecutorService.java +++ b/curator-client/src/main/java/org/apache/curator/utils/CloseableExecutorService.java @@ -116,7 +116,7 @@ public class CloseableExecutorService implements Closeable */ public CloseableExecutorService(ExecutorService executorService, boolean shutdownOnClose) { - this.executorService = Preconditions.checkNotNull(executorService); + this.executorService = Preconditions.checkNotNull(executorService, "executorService cannot be null"); this.shutdownOnClose = shutdownOnClose; } http://git-wip-us.apache.org/repos/asf/curator/blob/c7a1ea0e/curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/TreeCache.java ---------------------------------------------------------------------- diff --git a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/TreeCache.java b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/TreeCache.java index 3a7a1de..03ed982 100644 --- a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/TreeCache.java +++ b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/TreeCache.java @@ -97,16 +97,6 @@ public class TreeCache implements Closeable } /** - * Builds the {@link TreeCache} based on configured values, and starts it. - */ - public TreeCache buildAndStart() throws Exception - { - TreeCache treeCache = build(); - treeCache.start(); - return treeCache; - } - - /** * Sets whether or not to cache byte data per node; default {@code true}. */ public Builder setCacheData(boolean cacheData) @@ -507,9 +497,10 @@ public class TreeCache implements Closeable /** * Start the cache. The cache is not started automatically. You must call this method. * + * @return this * @throws Exception errors */ - public void start() throws Exception + public TreeCache start() throws Exception { Preconditions.checkState(treeState.compareAndSet(TreeState.LATENT, TreeState.STARTED), "already started"); client.getConnectionStateListenable().addListener(connectionStateListener); @@ -517,6 +508,7 @@ public class TreeCache implements Closeable { root.wasCreated(); } + return this; } /**