You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by gg...@apache.org on 2020/11/24 20:33:23 UTC
[httpcomponents-client] 05/07: No need to explicitly declare an
array when calling a vararg method.
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch 4.5.x
in repository https://gitbox.apache.org/repos/asf/httpcomponents-client.git
commit 80ec9818955537cb011c6d8123f170ab5d763997
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Mon Nov 23 12:30:36 2020 -0500
No need to explicitly declare an array when calling a vararg method.
---
.../org/apache/http/impl/client/AbstractAuthenticationHandler.java | 5 ++---
.../org/apache/http/impl/client/CloseableHttpResponseProxy.java | 2 +-
.../http/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 7f02074..a41af7a 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<String> 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 da67b7e..fb21892 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 5862f76..707ca9f 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);