Repository: curator Updated Branches: refs/heads/CURATOR-130 [created] f5767c890
CURATOR-130 Add null check to input processing. Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/f5767c89 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/f5767c89 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/f5767c89 Branch: refs/heads/CURATOR-130 Commit: f5767c8909d25761fcc5ed1a8f462fb8f0533487 Parents: dcb44a1 Author: Mike Drob <[email protected]> Authored: Thu Jul 31 15:10:17 2014 -0500 Committer: Mike Drob <[email protected]> Committed: Thu Jul 31 15:10:17 2014 -0500 ---------------------------------------------------------------------- curator-examples/src/main/java/cache/PathCacheExample.java | 8 +++++++- .../src/main/java/discovery/DiscoveryExample.java | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/curator/blob/f5767c89/curator-examples/src/main/java/cache/PathCacheExample.java ---------------------------------------------------------------------- diff --git a/curator-examples/src/main/java/cache/PathCacheExample.java b/curator-examples/src/main/java/cache/PathCacheExample.java index eec01bc..bec8093 100644 --- a/curator-examples/src/main/java/cache/PathCacheExample.java +++ b/curator-examples/src/main/java/cache/PathCacheExample.java @@ -119,7 +119,13 @@ public class PathCacheExample { System.out.print("> "); - String command = in.readLine().trim(); + String line = in.readLine(); + if ( line == null ) + { + break; + } + + String command = line.trim(); String[] parts = command.split("\\s"); if ( parts.length == 0 ) { http://git-wip-us.apache.org/repos/asf/curator/blob/f5767c89/curator-examples/src/main/java/discovery/DiscoveryExample.java ---------------------------------------------------------------------- diff --git a/curator-examples/src/main/java/discovery/DiscoveryExample.java b/curator-examples/src/main/java/discovery/DiscoveryExample.java index 6313207..d377e5e 100644 --- a/curator-examples/src/main/java/discovery/DiscoveryExample.java +++ b/curator-examples/src/main/java/discovery/DiscoveryExample.java @@ -91,7 +91,13 @@ public class DiscoveryExample { System.out.print("> "); - String command = in.readLine().trim(); + String line = in.readLine(); + if ( line == null ) + { + break; + } + + String command = line.trim(); String[] parts = command.split("\\s"); if ( parts.length == 0 ) {
