From 80ec9818955537cb011c6d8123f170ab5d763997 Mon Sep 17 00:00:00 2001 From: Gary Gregory Date: Mon, 23 Nov 2020 12:30:36 -0500 Subject: [PATCH] No need to explicitly declare an array when calling a vararg method. --- .../http/impl/client/AbstractAuthenticationHandler.java | 5 ++--- .../http/impl/client/CloseableHttpResponseProxy.java | 2 +- .../impl/client/integration/TestConnectionManagement.java | 7 +++---- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/httpclient/src/main/java-deprecated/org/apache/http/impl/client/AbstractAuthenticationHandler.java b/httpclient/src/main/java-deprecated/org/apache/http/impl/client/AbstractAuthenticationHandler.java index 7f020749a..a41af7af4 100644 --- a/httpclient/src/main/java-deprecated/org/apache/http/impl/client/AbstractAuthenticationHandler.java +++ b/httpclient/src/main/java-deprecated/org/apache/http/impl/client/AbstractAuthenticationHandler.java @@ -68,12 +68,11 @@ public abstract class AbstractAuthenticationHandler implements AuthenticationHan private final Log log = LogFactory.getLog(getClass()); private static final List DEFAULT_SCHEME_PRIORITY = - Collections.unmodifiableList(Arrays.asList(new String[] { + Collections.unmodifiableList(Arrays.asList( AuthPolicy.SPNEGO, AuthPolicy.NTLM, AuthPolicy.DIGEST, - AuthPolicy.BASIC - })); + AuthPolicy.BASIC)); public AbstractAuthenticationHandler() { super(); diff --git a/httpclient/src/main/java-deprecated/org/apache/http/impl/client/CloseableHttpResponseProxy.java b/httpclient/src/main/java-deprecated/org/apache/http/impl/client/CloseableHttpResponseProxy.java index da67b7e4b..fb21892bd 100644 --- a/httpclient/src/main/java-deprecated/org/apache/http/impl/client/CloseableHttpResponseProxy.java +++ b/httpclient/src/main/java-deprecated/org/apache/http/impl/client/CloseableHttpResponseProxy.java @@ -50,7 +50,7 @@ class CloseableHttpResponseProxy implements InvocationHandler { static { try { CONSTRUCTOR = Proxy.getProxyClass(CloseableHttpResponseProxy.class.getClassLoader(), - new Class[] { CloseableHttpResponse.class }).getConstructor(new Class[] { InvocationHandler.class }); + CloseableHttpResponse.class).getConstructor(InvocationHandler.class); } catch (final NoSuchMethodException ex) { throw new IllegalStateException(ex); } diff --git a/httpclient/src/test/java/org/apache/http/impl/client/integration/TestConnectionManagement.java b/httpclient/src/test/java/org/apache/http/impl/client/integration/TestConnectionManagement.java index 5862f7629..707ca9f2d 100644 --- a/httpclient/src/test/java/org/apache/http/impl/client/integration/TestConnectionManagement.java +++ b/httpclient/src/test/java/org/apache/http/impl/client/integration/TestConnectionManagement.java @@ -40,7 +40,6 @@ import java.util.concurrent.atomic.AtomicReference; import org.apache.http.HttpClientConnection; import org.apache.http.HttpHost; import org.apache.http.HttpRequest; -import org.apache.http.HttpRequestInterceptor; import org.apache.http.HttpResponse; import org.apache.http.HttpStatus; import org.apache.http.HttpVersion; @@ -114,7 +113,7 @@ public class TestConnectionManagement extends LocalServerTestBase { context.setAttribute(HttpCoreContext.HTTP_TARGET_HOST, target); final HttpProcessor httpProcessor = new ImmutableHttpProcessor( - new HttpRequestInterceptor[] { new RequestContent(), new RequestConnControl() }); + new RequestContent(), new RequestConnControl()); final HttpRequestExecutor exec = new HttpRequestExecutor(); exec.preProcess(request, httpProcessor, context); @@ -203,7 +202,7 @@ public class TestConnectionManagement extends LocalServerTestBase { context.setAttribute(HttpCoreContext.HTTP_TARGET_HOST, target); final HttpProcessor httpProcessor = new ImmutableHttpProcessor( - new HttpRequestInterceptor[] { new RequestContent(), new RequestConnControl() }); + new RequestContent(), new RequestConnControl()); final HttpRequestExecutor exec = new HttpRequestExecutor(); exec.preProcess(request, httpProcessor, context); @@ -401,7 +400,7 @@ public class TestConnectionManagement extends LocalServerTestBase { context.setAttribute(HttpCoreContext.HTTP_TARGET_HOST, target); final HttpProcessor httpProcessor = new ImmutableHttpProcessor( - new HttpRequestInterceptor[] { new RequestContent(), new RequestConnControl() }); + new RequestContent(), new RequestConnControl()); final HttpRequestExecutor exec = new HttpRequestExecutor(); exec.preProcess(request, httpProcessor, context);