Return-Path: X-Original-To: apmail-curator-commits-archive@minotaur.apache.org Delivered-To: apmail-curator-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 913A7119DE for ; Thu, 31 Jul 2014 20:12:46 +0000 (UTC) Received: (qmail 43645 invoked by uid 500); 31 Jul 2014 20:12:46 -0000 Delivered-To: apmail-curator-commits-archive@curator.apache.org Received: (qmail 43615 invoked by uid 500); 31 Jul 2014 20:12:46 -0000 Mailing-List: contact commits-help@curator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@curator.apache.org Delivered-To: mailing list commits@curator.apache.org Received: (qmail 43606 invoked by uid 99); 31 Jul 2014 20:12:46 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 31 Jul 2014 20:12:46 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 2B76A951528; Thu, 31 Jul 2014 20:12:46 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: randgalt@apache.org To: commits@curator.apache.org Message-Id: <65eb5a2543fd4562bbd90f4c1fe11d8f@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: git commit: CURATOR-130 Add null check to input processing. Date: Thu, 31 Jul 2014 20:12:46 +0000 (UTC) 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 Authored: Thu Jul 31 15:10:17 2014 -0500 Committer: Mike Drob 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 ) {