From 387b3b4c2ed36b95866182b0b1a73a21c4798b9f Mon Sep 17 00:00:00 2001 From: Cedric Beust Date: Tue, 6 Dec 2016 14:44:13 -0800 Subject: [PATCH] Reformat the httpProxy patch. --- .../main/java/com/beust/kobalt/wrapper/Main.java | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/modules/wrapper/src/main/java/com/beust/kobalt/wrapper/Main.java b/modules/wrapper/src/main/java/com/beust/kobalt/wrapper/Main.java index 52b64e41..b7fada45 100644 --- a/modules/wrapper/src/main/java/com/beust/kobalt/wrapper/Main.java +++ b/modules/wrapper/src/main/java/com/beust/kobalt/wrapper/Main.java @@ -433,13 +433,19 @@ public class Main { } private Proxy getProxy() { - String http_proxy = System.getenv("http_proxy"); + String httpProxy = System.getenv("http_proxy"); try { - String host = http_proxy == null || http_proxy.indexOf(':') == -1 ? "localhost" : http_proxy.substring(0, http_proxy.indexOf(':')); - int port = http_proxy == null || http_proxy.indexOf(':') == -1 ? 0 : Integer.parseInt(http_proxy.substring(http_proxy.indexOf(':') + 1)); - return http_proxy == null ? null : new Proxy(Proxy.Type.HTTP, new InetSocketAddress(host, port)); + String host = httpProxy == null || httpProxy.indexOf(':') == -1 + ? "localhost" + : httpProxy.substring(0, httpProxy.indexOf(':')); + int port = httpProxy == null || httpProxy.indexOf(':') == -1 + ? 0 + : Integer.parseInt(httpProxy.substring(httpProxy.indexOf(':') + 1)); + return httpProxy == null + ? null + : new Proxy(Proxy.Type.HTTP, new InetSocketAddress(host, port)); } catch (NumberFormatException e) { - log(1, "Warning: invalid proxy port: " + http_proxy);; + log(1, "Warning: invalid proxy port: " + httpProxy);; return null; } }