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 A72B311439 for ; Fri, 23 May 2014 12:25:26 +0000 (UTC) Received: (qmail 32606 invoked by uid 500); 23 May 2014 12:25:26 -0000 Delivered-To: apmail-curator-commits-archive@curator.apache.org Received: (qmail 32572 invoked by uid 500); 23 May 2014 12:25:26 -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 32564 invoked by uid 99); 23 May 2014 12:25:26 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 May 2014 12:25:26 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 5344399FF9B; Fri, 23 May 2014 12:25:26 +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 Date: Fri, 23 May 2014 12:25:27 -0000 Message-Id: <4eb8bcbfdba14ee3abbd95e56ae42453@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [3/5] git commit: No need for null check No need for null check Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/ac57e11b Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/ac57e11b Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/ac57e11b Branch: refs/heads/CURATOR-107 Commit: ac57e11b34bb2970775b385f5a1e94bccd287232 Parents: c971649 Author: Dominic Wong Authored: Wed May 21 13:45:54 2014 +0100 Committer: Dominic Wong Committed: Wed May 21 13:45:54 2014 +0100 ---------------------------------------------------------------------- .../framework/recipes/locks/LockInternals.java | 27 +++++++++----------- 1 file changed, 12 insertions(+), 15 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/curator/blob/ac57e11b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/locks/LockInternals.java ---------------------------------------------------------------------- diff --git a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/locks/LockInternals.java b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/locks/LockInternals.java index c66e4d1..d6298ce 100644 --- a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/locks/LockInternals.java +++ b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/locks/LockInternals.java @@ -298,24 +298,21 @@ public class LockInternals try { byte[] data = client.getData().usingWatcher(watcher).forPath(previousSequencePath); - if ( data != null ) + if ( millisToWait != null ) { - if ( millisToWait != null ) + millisToWait -= (System.currentTimeMillis() - startMillis); + startMillis = System.currentTimeMillis(); + if ( millisToWait <= 0 ) { - millisToWait -= (System.currentTimeMillis() - startMillis); - startMillis = System.currentTimeMillis(); - if ( millisToWait <= 0 ) - { - doDelete = true; // timed out - delete our node - break; - } - - wait(millisToWait); - } - else - { - wait(); + doDelete = true; // timed out - delete our node + break; } + + wait(millisToWait); + } + else + { + wait(); } } catch ( KeeperException.NoNodeException e )