Return-Path: X-Original-To: apmail-brooklyn-commits-archive@minotaur.apache.org Delivered-To: apmail-brooklyn-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 9D45511F54 for ; Thu, 26 Jun 2014 11:48:26 +0000 (UTC) Received: (qmail 42514 invoked by uid 500); 26 Jun 2014 11:48:26 -0000 Delivered-To: apmail-brooklyn-commits-archive@brooklyn.apache.org Received: (qmail 42491 invoked by uid 500); 26 Jun 2014 11:48:26 -0000 Mailing-List: contact commits-help@brooklyn.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@brooklyn.incubator.apache.org Delivered-To: mailing list commits@brooklyn.incubator.apache.org Received: (qmail 42481 invoked by uid 99); 26 Jun 2014 11:48:26 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Jun 2014 11:48:26 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO mail.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with SMTP; Thu, 26 Jun 2014 11:48:27 +0000 Received: (qmail 42373 invoked by uid 99); 26 Jun 2014 11:48:02 -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, 26 Jun 2014 11:48:02 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 1E066834D2E; Thu, 26 Jun 2014 11:48:01 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: heneveld@apache.org To: commits@brooklyn.incubator.apache.org Date: Thu, 26 Jun 2014 11:48:01 -0000 Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: [1/2] git commit: Fix LocalhostExternalIpLoader.getLocalhostIpWithin X-Virus-Checked: Checked by ClamAV on apache.org Repository: incubator-brooklyn Updated Branches: refs/heads/master 439c086f1 -> 94437c1a6 Fix LocalhostExternalIpLoader.getLocalhostIpWithin Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/f11cc4db Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/f11cc4db Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/f11cc4db Branch: refs/heads/master Commit: f11cc4dbf5fac358d41a22d4e11abc423a0e99d4 Parents: c2faca4 Author: Sam Corbett Authored: Wed Jun 25 18:20:02 2014 +0100 Committer: Sam Corbett Committed: Wed Jun 25 18:20:02 2014 +0100 ---------------------------------------------------------------------- .../java/brooklyn/location/geo/LocalhostExternalIpLoader.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/f11cc4db/core/src/main/java/brooklyn/location/geo/LocalhostExternalIpLoader.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/brooklyn/location/geo/LocalhostExternalIpLoader.java b/core/src/main/java/brooklyn/location/geo/LocalhostExternalIpLoader.java index 11bae12..fba42b9 100644 --- a/core/src/main/java/brooklyn/location/geo/LocalhostExternalIpLoader.java +++ b/core/src/main/java/brooklyn/location/geo/LocalhostExternalIpLoader.java @@ -92,8 +92,10 @@ public class LocalhostExternalIpLoader { */ public static String getLocalhostIpWithin(Duration timeout) { String result = doLoad(timeout); - if (result!=null) return null; - throw new IllegalStateException("Unable to retrieve external IP for localhost; network may be down or slow or remote service otherwise not responding"); + if (result == null) { + throw new IllegalStateException("Unable to retrieve external IP for localhost; network may be down or slow or remote service otherwise not responding"); + } + return result; } /**