Repository: curator Updated Branches: refs/heads/master 1571588f8 -> 337b9d929
check empty connection string in FixedEnsembleProvider Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/337b9d92 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/337b9d92 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/337b9d92 Branch: refs/heads/master Commit: 337b9d929c6e027719044559de65468c044c4251 Parents: 1571588 Author: Fangmin Lyu <allen...@fb.com> Authored: Sat Mar 11 15:06:20 2017 -0800 Committer: Fangmin Lyu <allen...@fb.com> Committed: Sat Mar 11 15:06:20 2017 -0800 ---------------------------------------------------------------------- .../apache/curator/ensemble/fixed/FixedEnsembleProvider.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/curator/blob/337b9d92/curator-client/src/main/java/org/apache/curator/ensemble/fixed/FixedEnsembleProvider.java ---------------------------------------------------------------------- diff --git a/curator-client/src/main/java/org/apache/curator/ensemble/fixed/FixedEnsembleProvider.java b/curator-client/src/main/java/org/apache/curator/ensemble/fixed/FixedEnsembleProvider.java index 411c712..ce650a9 100644 --- a/curator-client/src/main/java/org/apache/curator/ensemble/fixed/FixedEnsembleProvider.java +++ b/curator-client/src/main/java/org/apache/curator/ensemble/fixed/FixedEnsembleProvider.java @@ -19,6 +19,7 @@ package org.apache.curator.ensemble.fixed; import com.google.common.base.Preconditions; +import com.google.common.base.Strings; import org.apache.curator.ensemble.EnsembleProvider; import java.io.IOException; @@ -36,7 +37,9 @@ public class FixedEnsembleProvider implements EnsembleProvider */ public FixedEnsembleProvider(String connectionString) { - this.connectionString = Preconditions.checkNotNull(connectionString, "connectionString cannot be null"); + Preconditions.checkArgument(!Strings.isNullOrEmpty(connectionString), + "connectionString cannot be null or empty"); + this.connectionString = connectionString; } @Override