No need to explicitly declare an array when calling a vararg method.

This commit is contained in:
Gary Gregory 2020-11-23 12:30:36 -05:00 committed by Gary Gregory
parent 2e54182cdd
commit 80ec981895
3 changed files with 6 additions and 8 deletions

View File

@ -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();

View File

@ -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);
}

View File

@ -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);