From 92448db3b42c95ef3d245937a7b45ac598427981 Mon Sep 17 00:00:00 2001 From: Sebastian Bazley Date: Mon, 24 Feb 2014 18:41:11 +0000 Subject: [PATCH] fewer boxing conversions needed when stored as an object git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1571387 13f79535-47bb-0310-9956-ffa450edef68 --- .../http/osgi/impl/OSGiProxyConfiguration.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/httpclient-osgi/src/main/java/org/apache/http/osgi/impl/OSGiProxyConfiguration.java b/httpclient-osgi/src/main/java/org/apache/http/osgi/impl/OSGiProxyConfiguration.java index 39ba62533..3a0516014 100644 --- a/httpclient-osgi/src/main/java/org/apache/http/osgi/impl/OSGiProxyConfiguration.java +++ b/httpclient-osgi/src/main/java/org/apache/http/osgi/impl/OSGiProxyConfiguration.java @@ -81,11 +81,11 @@ public final class OSGiProxyConfiguration implements ProxyConfiguration { private static final String[] PROPERTYDEFAULT_PROXY_EXCEPTIONS = new String[]{"localhost", "127.0.0.1"}; - private boolean enabled; + private Boolean enabled = Boolean.FALSE; // fewer boxing conversions needed when stored as an object private String hostname; - private int port; + private Integer port = Integer.valueOf(0); // fewer boxing conversions needed when stored as an object private String username; @@ -95,7 +95,7 @@ public final class OSGiProxyConfiguration implements ProxyConfiguration { @Override public boolean isEnabled() { - return enabled; + return enabled.booleanValue(); } @Override @@ -105,7 +105,7 @@ public final class OSGiProxyConfiguration implements ProxyConfiguration { @Override public int getPort() { - return port; + return port.intValue(); } @Override @@ -124,9 +124,9 @@ public final class OSGiProxyConfiguration implements ProxyConfiguration { } public void update(final Dictionary config) { - enabled = to(config.get(PROPERTYNAME_PROXY_ENABLED), boolean.class, PROPERTYDEFAULT_PROXY_ENABLED).booleanValue(); + enabled = to(config.get(PROPERTYNAME_PROXY_ENABLED), boolean.class, PROPERTYDEFAULT_PROXY_ENABLED); hostname = to(config.get(PROPERTYNAME_PROXY_HOSTNAME), String.class, PROPERTYDEFAULT_PROXY_HOSTNAME); - port = to(config.get(PROPERTYNAME_PROXY_PORT), int.class, PROPERTYDEFAULT_PROXY_PORT).intValue(); + port = to(config.get(PROPERTYNAME_PROXY_PORT), int.class, PROPERTYDEFAULT_PROXY_PORT); username = to(config.get(PROPERTYNAME_PROXY_USERNAME), String.class, PROPERTYDEFAULT_PROXY_USERNAME); password = to(config.get(PROPERTYNAME_PROXY_PASSWORD), String.class, PROPERTYDEFAULT_PROXY_PASSWORD); proxyExceptions = to(config.get(PROPERTYNAME_PROXY_EXCEPTIONS), String[].class, PROPERTYDEFAULT_PROXY_EXCEPTIONS);