Redundant type declarations
diff --git a/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/bootstrap/H2ServerBootstrap.java b/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/bootstrap/H2ServerBootstrap.java
index 884c3a6..7622f31 100644
--- a/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/bootstrap/H2ServerBootstrap.java
+++ b/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/bootstrap/H2ServerBootstrap.java
@@ -345,7 +345,7 @@
final RequestHandlerRegistry<Supplier<AsyncServerExchangeHandler>> registry = new RequestHandlerRegistry<>(
actualCanonicalHostName,
() -> lookupRegistry != null ? lookupRegistry :
- UriPatternType.<Supplier<AsyncServerExchangeHandler>>newMatcher(UriPatternType.URI_PATTERN));
+ UriPatternType.newMatcher(UriPatternType.URI_PATTERN));
for (final HandlerEntry<Supplier<AsyncServerExchangeHandler>> entry: handlerList) {
registry.register(entry.hostname, entry.uriPattern, entry.handler);
}
diff --git a/httpcore5-h2/src/test/java/org/apache/hc/core5/http2/hpack/TestHPackCoding.java b/httpcore5-h2/src/test/java/org/apache/hc/core5/http2/hpack/TestHPackCoding.java
index 57ab798..0eac03f 100644
--- a/httpcore5-h2/src/test/java/org/apache/hc/core5/http2/hpack/TestHPackCoding.java
+++ b/httpcore5-h2/src/test/java/org/apache/hc/core5/http2/hpack/TestHPackCoding.java
@@ -719,7 +719,7 @@
final HPackEncoder encoder = new HPackEncoder(dynamicTable, StandardCharsets.US_ASCII);
final ByteArrayBuffer buf = new ByteArrayBuffer(256);
- final List<Header> headers1 = Arrays.<Header>asList(
+ final List<Header> headers1 = Arrays.asList(
new BasicHeader(":method", "GET"),
new BasicHeader(":scheme", "http"),
new BasicHeader(":path", "/"),
@@ -736,7 +736,7 @@
assertHeaderEquals(new BasicHeader(":authority", "www.example.com"), dynamicTable.getDynamicEntry(0));
Assert.assertEquals(57, dynamicTable.getCurrentSize());
- final List<Header> headers2 = Arrays.<Header>asList(
+ final List<Header> headers2 = Arrays.asList(
new BasicHeader(":method", "GET"),
new BasicHeader(":scheme", "http"),
new BasicHeader(":path", "/"),
@@ -755,7 +755,7 @@
assertHeaderEquals(new BasicHeader(":authority", "www.example.com"), dynamicTable.getDynamicEntry(1));
Assert.assertEquals(110, dynamicTable.getCurrentSize());
- final List<Header> headers3 = Arrays.<Header>asList(
+ final List<Header> headers3 = Arrays.asList(
new BasicHeader(":method", "GET"),
new BasicHeader(":scheme", "https"),
new BasicHeader(":path", "/index.html"),
@@ -784,7 +784,7 @@
final HPackEncoder encoder = new HPackEncoder(dynamicTable, StandardCharsets.US_ASCII);
final ByteArrayBuffer buf = new ByteArrayBuffer(256);
- final List<Header> headers1 = Arrays.<Header>asList(
+ final List<Header> headers1 = Arrays.asList(
new BasicHeader(":method", "GET"),
new BasicHeader(":scheme", "http"),
new BasicHeader(":path", "/"),
@@ -800,7 +800,7 @@
assertHeaderEquals(new BasicHeader(":authority", "www.example.com"), dynamicTable.getDynamicEntry(0));
Assert.assertEquals(57, dynamicTable.getCurrentSize());
- final List<Header> headers2 = Arrays.<Header>asList(
+ final List<Header> headers2 = Arrays.asList(
new BasicHeader(":method", "GET"),
new BasicHeader(":scheme", "http"),
new BasicHeader(":path", "/"),
@@ -819,7 +819,7 @@
assertHeaderEquals(new BasicHeader(":authority", "www.example.com"), dynamicTable.getDynamicEntry(1));
Assert.assertEquals(110, dynamicTable.getCurrentSize());
- final List<Header> headers3 = Arrays.<Header>asList(
+ final List<Header> headers3 = Arrays.asList(
new BasicHeader(":method", "GET"),
new BasicHeader(":scheme", "https"),
new BasicHeader(":path", "/index.html"),
@@ -849,7 +849,7 @@
final HPackEncoder encoder = new HPackEncoder(dynamicTable, StandardCharsets.US_ASCII);
final ByteArrayBuffer buf = new ByteArrayBuffer(256);
- final List<Header> headers1 = Arrays.<Header>asList(
+ final List<Header> headers1 = Arrays.asList(
new BasicHeader(":status", "302"),
new BasicHeader("cache-control", "private"),
new BasicHeader("date", "Mon, 21 Oct 2013 20:13:21 GMT"),
@@ -872,7 +872,7 @@
assertHeaderEquals(new BasicHeader(":status", "302"), dynamicTable.getDynamicEntry(3));
Assert.assertEquals(222, dynamicTable.getCurrentSize());
- final List<Header> headers2 = Arrays.<Header>asList(
+ final List<Header> headers2 = Arrays.asList(
new BasicHeader(":status", "307"),
new BasicHeader("cache-control", "private"),
new BasicHeader("date", "Mon, 21 Oct 2013 20:13:21 GMT"),
@@ -893,7 +893,7 @@
Assert.assertEquals(222, dynamicTable.getCurrentSize());
- final List<Header> headers3 = Arrays.<Header>asList(
+ final List<Header> headers3 = Arrays.asList(
new BasicHeader(":status", "200"),
new BasicHeader("cache-control", "private"),
new BasicHeader("date", "Mon, 21 Oct 2013 20:13:22 GMT"),
@@ -929,7 +929,7 @@
final HPackEncoder encoder = new HPackEncoder(dynamicTable, StandardCharsets.US_ASCII);
final ByteArrayBuffer buf = new ByteArrayBuffer(256);
- final List<Header> headers1 = Arrays.<Header>asList(
+ final List<Header> headers1 = Arrays.asList(
new BasicHeader(":status", "302"),
new BasicHeader("cache-control", "private"),
new BasicHeader("date", "Mon, 21 Oct 2013 20:13:21 GMT"),
@@ -951,7 +951,7 @@
assertHeaderEquals(new BasicHeader(":status", "302"), dynamicTable.getDynamicEntry(3));
Assert.assertEquals(222, dynamicTable.getCurrentSize());
- final List<Header> headers2 = Arrays.<Header>asList(
+ final List<Header> headers2 = Arrays.asList(
new BasicHeader(":status", "307"),
new BasicHeader("cache-control", "private"),
new BasicHeader("date", "Mon, 21 Oct 2013 20:13:21 GMT"),
@@ -972,7 +972,7 @@
Assert.assertEquals(222, dynamicTable.getCurrentSize());
- final List<Header> headers3 = Arrays.<Header>asList(
+ final List<Header> headers3 = Arrays.asList(
new BasicHeader(":status", "200"),
new BasicHeader("cache-control", "private"),
new BasicHeader("date", "Mon, 21 Oct 2013 20:13:22 GMT"),
diff --git a/httpcore5-h2/src/test/java/org/apache/hc/core5/http2/impl/TestDefaultH2RequestConverter.java b/httpcore5-h2/src/test/java/org/apache/hc/core5/http2/impl/TestDefaultH2RequestConverter.java
index f15078a..17f6251 100644
--- a/httpcore5-h2/src/test/java/org/apache/hc/core5/http2/impl/TestDefaultH2RequestConverter.java
+++ b/httpcore5-h2/src/test/java/org/apache/hc/core5/http2/impl/TestDefaultH2RequestConverter.java
@@ -50,7 +50,7 @@
@Test
public void testConvertFromFieldsBasic() throws Exception {
- final List<Header> headers = Arrays.<Header>asList(
+ final List<Header> headers = Arrays.asList(
new BasicHeader(":method", "GET"),
new BasicHeader(":scheme", "http"),
new BasicHeader(":authority", "www.example.com"),
@@ -76,7 +76,7 @@
thrown.expect(HttpException.class);
thrown.expectMessage("Header name ':Path' is invalid (header name contains uppercase characters)");
- final List<Header> headers = Arrays.<Header>asList(
+ final List<Header> headers = Arrays.asList(
new BasicHeader(":method", "GET"),
new BasicHeader(":scheme", "http"),
new BasicHeader(":authority", "www.example.com"),
@@ -93,7 +93,7 @@
thrown.expect(HttpException.class);
thrown.expectMessage("Header 'connection: keep-alive' is illegal for HTTP/2 messages");
- final List<Header> headers = Arrays.<Header>asList(
+ final List<Header> headers = Arrays.asList(
new BasicHeader(":method", "GET"),
new BasicHeader(":scheme", "http"),
new BasicHeader(":authority", "www.example.com"),
@@ -110,7 +110,7 @@
thrown.expect(HttpException.class);
thrown.expectMessage("Invalid sequence of headers (pseudo-headers must precede message headers)");
- final List<Header> headers = Arrays.<Header>asList(
+ final List<Header> headers = Arrays.asList(
new BasicHeader(":method", "GET"),
new BasicHeader(":scheme", "http"),
new BasicHeader("custom", "value"),
@@ -127,7 +127,7 @@
thrown.expect(HttpException.class);
thrown.expectMessage("Mandatory request header ':method' not found");
- final List<Header> headers = Arrays.<Header>asList(
+ final List<Header> headers = Arrays.asList(
new BasicHeader(":scheme", "http"),
new BasicHeader(":authority", "www.example.com"),
new BasicHeader(":path", "/"),
@@ -143,7 +143,7 @@
thrown.expect(HttpException.class);
thrown.expectMessage("Mandatory request header ':scheme' not found");
- final List<Header> headers = Arrays.<Header>asList(
+ final List<Header> headers = Arrays.asList(
new BasicHeader(":method", "GET"),
new BasicHeader(":authority", "www.example.com"),
new BasicHeader(":path", "/"),
@@ -159,7 +159,7 @@
thrown.expect(HttpException.class);
thrown.expectMessage("Mandatory request header ':path' not found");
- final List<Header> headers = Arrays.<Header>asList(
+ final List<Header> headers = Arrays.asList(
new BasicHeader(":method", "GET"),
new BasicHeader(":scheme", "http"),
new BasicHeader(":authority", "www.example.com"),
@@ -175,7 +175,7 @@
thrown.expect(HttpException.class);
thrown.expectMessage("Unsupported request header ':custom'");
- final List<Header> headers = Arrays.<Header>asList(
+ final List<Header> headers = Arrays.asList(
new BasicHeader(":method", "GET"),
new BasicHeader(":scheme", "http"),
new BasicHeader(":authority", "www.example.com"),
@@ -192,7 +192,7 @@
thrown.expect(HttpException.class);
thrown.expectMessage("Multiple ':method' request headers are illegal");
- final List<Header> headers = Arrays.<Header>asList(
+ final List<Header> headers = Arrays.asList(
new BasicHeader(":method", "GET"),
new BasicHeader(":method", "GET"),
new BasicHeader(":scheme", "http"),
@@ -210,7 +210,7 @@
thrown.expect(HttpException.class);
thrown.expectMessage("Multiple ':scheme' request headers are illegal");
- final List<Header> headers = Arrays.<Header>asList(
+ final List<Header> headers = Arrays.asList(
new BasicHeader(":method", "GET"),
new BasicHeader(":scheme", "http"),
new BasicHeader(":scheme", "https"),
@@ -228,7 +228,7 @@
thrown.expect(HttpException.class);
thrown.expectMessage("Multiple ':path' request headers are illegal");
- final List<Header> headers = Arrays.<Header>asList(
+ final List<Header> headers = Arrays.asList(
new BasicHeader(":method", "GET"),
new BasicHeader(":scheme", "https"),
new BasicHeader(":authority", "www.example.com"),
@@ -243,7 +243,7 @@
@Test
public void testConvertFromFieldsConnect() throws Exception {
- final List<Header> headers = Arrays.<Header>asList(
+ final List<Header> headers = Arrays.asList(
new BasicHeader(":method", "CONNECT"),
new BasicHeader(":authority", "www.example.com"),
new BasicHeader("custom", "value"));
@@ -258,7 +258,7 @@
thrown.expect(HttpException.class);
thrown.expectMessage("Header ':authority' is mandatory for CONNECT request");
- final List<Header> headers = Arrays.<Header>asList(
+ final List<Header> headers = Arrays.asList(
new BasicHeader(":method", "CONNECT"),
new BasicHeader("custom", "value"));
@@ -272,7 +272,7 @@
thrown.expect(HttpException.class);
thrown.expectMessage("Header ':scheme' must not be set for CONNECT request");
- final List<Header> headers = Arrays.<Header>asList(
+ final List<Header> headers = Arrays.asList(
new BasicHeader(":method", "CONNECT"),
new BasicHeader(":scheme", "http"),
new BasicHeader(":authority", "www.example.com"),
@@ -288,7 +288,7 @@
thrown.expect(HttpException.class);
thrown.expectMessage("Header ':path' must not be set for CONNECT request");
- final List<Header> headers = Arrays.<Header>asList(
+ final List<Header> headers = Arrays.asList(
new BasicHeader(":method", "CONNECT"),
new BasicHeader(":authority", "www.example.com"),
new BasicHeader(":path", "/"),
diff --git a/httpcore5-h2/src/test/java/org/apache/hc/core5/http2/impl/TestDefaultH2ResponseConverter.java b/httpcore5-h2/src/test/java/org/apache/hc/core5/http2/impl/TestDefaultH2ResponseConverter.java
index b3af5d7..1d16d06 100644
--- a/httpcore5-h2/src/test/java/org/apache/hc/core5/http2/impl/TestDefaultH2ResponseConverter.java
+++ b/httpcore5-h2/src/test/java/org/apache/hc/core5/http2/impl/TestDefaultH2ResponseConverter.java
@@ -48,7 +48,7 @@
@Test
public void testConvertFromFieldsBasic() throws Exception {
- final List<Header> headers = Arrays.<Header>asList(
+ final List<Header> headers = Arrays.asList(
new BasicHeader(":status", "200"),
new BasicHeader("location", "http://www.example.com/"),
new BasicHeader("custom123", "value"));
@@ -71,7 +71,7 @@
thrown.expect(HttpException.class);
thrown.expectMessage("Header name ':Status' is invalid (header name contains uppercase characters)");
- final List<Header> headers = Arrays.<Header>asList(
+ final List<Header> headers = Arrays.asList(
new BasicHeader(":Status", "200"),
new BasicHeader("location", "http://www.example.com/"),
new BasicHeader("custom123", "value"));
@@ -86,7 +86,7 @@
thrown.expect(HttpException.class);
thrown.expectMessage("Invalid response status: boom");
- final List<Header> headers = Arrays.<Header>asList(
+ final List<Header> headers = Arrays.asList(
new BasicHeader(":status", "boom"),
new BasicHeader("location", "http://www.example.com/"),
new BasicHeader("custom123", "value"));
@@ -101,7 +101,7 @@
thrown.expect(HttpException.class);
thrown.expectMessage("Header 'connection: keep-alive' is illegal for HTTP/2 messages");
- final List<Header> headers = Arrays.<Header>asList(
+ final List<Header> headers = Arrays.asList(
new BasicHeader(":status", "200"),
new BasicHeader("location", "http://www.example.com/"),
new BasicHeader("connection", "keep-alive"));
@@ -116,7 +116,7 @@
thrown.expect(HttpException.class);
thrown.expectMessage("Mandatory response header ':status' not found");
- final List<Header> headers = Arrays.<Header>asList(
+ final List<Header> headers = Arrays.asList(
new BasicHeader("location", "http://www.example.com/"),
new BasicHeader("custom", "value"));
@@ -130,7 +130,7 @@
thrown.expect(HttpException.class);
thrown.expectMessage("Unsupported response header ':custom'");
- final List<Header> headers = Arrays.<Header>asList(
+ final List<Header> headers = Arrays.asList(
new BasicHeader(":status", "200"),
new BasicHeader(":custom", "200"),
new BasicHeader("location", "http://www.example.com/"),
@@ -146,7 +146,7 @@
thrown.expect(HttpException.class);
thrown.expectMessage("Multiple ':status' response headers are illegal");
- final List<Header> headers = Arrays.<Header>asList(
+ final List<Header> headers = Arrays.asList(
new BasicHeader(":status", "200"),
new BasicHeader(":status", "200"),
new BasicHeader("location", "http://www.example.com/"),
diff --git a/httpcore5-reactive/src/test/java/org/apache/hc/core5/reactive/TestReactiveDataProducer.java b/httpcore5-reactive/src/test/java/org/apache/hc/core5/reactive/TestReactiveDataProducer.java
index 73c6c77..71f3b1d 100644
--- a/httpcore5-reactive/src/test/java/org/apache/hc/core5/reactive/TestReactiveDataProducer.java
+++ b/httpcore5-reactive/src/test/java/org/apache/hc/core5/reactive/TestReactiveDataProducer.java
@@ -68,7 +68,7 @@
ByteBuffer.wrap(new byte[]{ '4' }),
ByteBuffer.wrap(new byte[]{ '5' }),
ByteBuffer.wrap(new byte[]{ '6' })),
- Flowable.<ByteBuffer>error(new RuntimeException())
+ Flowable.error(new RuntimeException())
);
final ReactiveDataProducer producer = new ReactiveDataProducer(publisher);
diff --git a/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/framework/TestTestingFramework.java b/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/framework/TestTestingFramework.java
index 1501bd5..9328243 100644
--- a/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/framework/TestTestingFramework.java
+++ b/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/framework/TestTestingFramework.java
@@ -130,7 +130,7 @@
final ClientTestingAdapter adapter = Mockito.mock(ClientTestingAdapter.class);
// Have isRequestSupported() return false so no test will run.
- Mockito.when(adapter.isRequestSupported(ArgumentMatchers.<String, Object>anyMap()))
+ Mockito.when(adapter.isRequestSupported(ArgumentMatchers.anyMap()))
.thenReturn(false);
final TestingFramework framework = newWebServerTestingFramework(adapter);
@@ -142,8 +142,8 @@
}
private void verifyCallMethodNeverCalled(final ClientTestingAdapter adapter) throws Exception {
- Mockito.verify(adapter, Mockito.never()).execute(ArgumentMatchers.anyString(), ArgumentMatchers.<String, Object>anyMap(),
- ArgumentMatchers.any(TestingFrameworkRequestHandler.class), ArgumentMatchers.<String, Object>anyMap());
+ Mockito.verify(adapter, Mockito.never()).execute(ArgumentMatchers.anyString(), ArgumentMatchers.anyMap(),
+ ArgumentMatchers.any(TestingFrameworkRequestHandler.class), ArgumentMatchers.anyMap());
}
private TestingFramework newFrameworkAndSetAdapter(final ClientTestingAdapter adapter)
diff --git a/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/H2ProtocolNegotiationTest.java b/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/H2ProtocolNegotiationTest.java
index 624e66f..d25d325 100644
--- a/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/H2ProtocolNegotiationTest.java
+++ b/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/H2ProtocolNegotiationTest.java
@@ -178,7 +178,7 @@
MatcherAssert.assertThat(message1, CoreMatchers.notNullValue());
final HttpResponse response1 = message1.getHead();
MatcherAssert.assertThat(response1.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
- MatcherAssert.assertThat(response1.getVersion(), CoreMatchers.<ProtocolVersion>equalTo(HttpVersion.HTTP_1_1));
+ MatcherAssert.assertThat(response1.getVersion(), CoreMatchers.equalTo(HttpVersion.HTTP_1_1));
}
@Test
@@ -201,7 +201,7 @@
MatcherAssert.assertThat(message1, CoreMatchers.notNullValue());
final HttpResponse response1 = message1.getHead();
MatcherAssert.assertThat(response1.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
- MatcherAssert.assertThat(response1.getVersion(), CoreMatchers.<ProtocolVersion>equalTo(HttpVersion.HTTP_2));
+ MatcherAssert.assertThat(response1.getVersion(), CoreMatchers.equalTo(HttpVersion.HTTP_2));
}
@Test
@@ -226,9 +226,9 @@
MatcherAssert.assertThat(response1.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
if (isAlpnSupported()) {
- MatcherAssert.assertThat(response1.getVersion(), CoreMatchers.<ProtocolVersion>equalTo(HttpVersion.HTTP_2));
+ MatcherAssert.assertThat(response1.getVersion(), CoreMatchers.equalTo(HttpVersion.HTTP_2));
} else {
- MatcherAssert.assertThat(response1.getVersion(), CoreMatchers.<ProtocolVersion>equalTo(HttpVersion.HTTP_1_1));
+ MatcherAssert.assertThat(response1.getVersion(), CoreMatchers.equalTo(HttpVersion.HTTP_1_1));
}
}
diff --git a/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/H2TLSIntegrationTest.java b/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/H2TLSIntegrationTest.java
index 0d2291c..889b35b 100644
--- a/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/H2TLSIntegrationTest.java
+++ b/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/H2TLSIntegrationTest.java
@@ -214,7 +214,7 @@
Assert.fail("ExecutionException expected");
} catch (final ExecutionException ex) {
final Throwable cause = ex.getCause();
- MatcherAssert.assertThat(cause, CoreMatchers.<Throwable>instanceOf(SSLHandshakeException.class));
+ MatcherAssert.assertThat(cause, CoreMatchers.instanceOf(SSLHandshakeException.class));
}
}
@@ -266,7 +266,7 @@
Assert.fail("ExecutionException expected");
} catch (final ExecutionException ex) {
final Throwable cause = ex.getCause();
- MatcherAssert.assertThat(cause, CoreMatchers.<Throwable>instanceOf(IOException.class));
+ MatcherAssert.assertThat(cause, CoreMatchers.instanceOf(IOException.class));
}
}
@@ -318,7 +318,7 @@
Assert.fail("ExecutionException expected");
} catch (final ExecutionException ex) {
final Throwable cause = ex.getCause();
- MatcherAssert.assertThat(cause, CoreMatchers.<Throwable>instanceOf(IOException.class));
+ MatcherAssert.assertThat(cause, CoreMatchers.instanceOf(IOException.class));
}
}
@@ -388,7 +388,7 @@
Assert.fail("ExecutionException expected");
} catch (final ExecutionException ex) {
final Throwable cause = ex.getCause();
- MatcherAssert.assertThat(cause, CoreMatchers.<Throwable>instanceOf(IOException.class));
+ MatcherAssert.assertThat(cause, CoreMatchers.instanceOf(IOException.class));
}
} finally {
server.close(CloseMode.IMMEDIATE);
diff --git a/httpcore5/src/main/java/org/apache/hc/core5/http/impl/bootstrap/AsyncServerBootstrap.java b/httpcore5/src/main/java/org/apache/hc/core5/http/impl/bootstrap/AsyncServerBootstrap.java
index 640cab8..0b3fa81 100644
--- a/httpcore5/src/main/java/org/apache/hc/core5/http/impl/bootstrap/AsyncServerBootstrap.java
+++ b/httpcore5/src/main/java/org/apache/hc/core5/http/impl/bootstrap/AsyncServerBootstrap.java
@@ -322,7 +322,7 @@
final RequestHandlerRegistry<Supplier<AsyncServerExchangeHandler>> registry = new RequestHandlerRegistry<>(
canonicalHostName != null ? canonicalHostName : InetAddressUtils.getCanonicalLocalHostName(),
() -> lookupRegistry != null ? lookupRegistry :
- UriPatternType.<Supplier<AsyncServerExchangeHandler>>newMatcher(UriPatternType.URI_PATTERN));
+ UriPatternType.newMatcher(UriPatternType.URI_PATTERN));
for (final HandlerEntry<Supplier<AsyncServerExchangeHandler>> entry: handlerList) {
registry.register(entry.hostname, entry.uriPattern, entry.handler);
}
diff --git a/httpcore5/src/main/java/org/apache/hc/core5/http/impl/bootstrap/ServerBootstrap.java b/httpcore5/src/main/java/org/apache/hc/core5/http/impl/bootstrap/ServerBootstrap.java
index 9711772..e26d989 100644
--- a/httpcore5/src/main/java/org/apache/hc/core5/http/impl/bootstrap/ServerBootstrap.java
+++ b/httpcore5/src/main/java/org/apache/hc/core5/http/impl/bootstrap/ServerBootstrap.java
@@ -325,7 +325,7 @@
final RequestHandlerRegistry<HttpRequestHandler> handlerRegistry = new RequestHandlerRegistry<>(
canonicalHostName != null ? canonicalHostName : InetAddressUtils.getCanonicalLocalHostName(),
() -> lookupRegistry != null ? lookupRegistry :
- UriPatternType.<HttpRequestHandler>newMatcher(UriPatternType.URI_PATTERN));
+ UriPatternType.newMatcher(UriPatternType.URI_PATTERN));
for (final HandlerEntry<HttpRequestHandler> entry: handlerList) {
handlerRegistry.register(entry.hostname, entry.uriPattern, entry.handler);
}
diff --git a/httpcore5/src/main/java/org/apache/hc/core5/net/URIBuilder.java b/httpcore5/src/main/java/org/apache/hc/core5/net/URIBuilder.java
index 94df9c0..894db16 100644
--- a/httpcore5/src/main/java/org/apache/hc/core5/net/URIBuilder.java
+++ b/httpcore5/src/main/java/org/apache/hc/core5/net/URIBuilder.java
@@ -829,7 +829,7 @@
}
public List<String> getPathSegments() {
- return this.pathSegments != null ? new ArrayList<>(this.pathSegments) : Collections.<String>emptyList();
+ return this.pathSegments != null ? new ArrayList<>(this.pathSegments) : Collections.emptyList();
}
public String getPath() {
@@ -848,7 +848,7 @@
}
public List<NameValuePair> getQueryParams() {
- return this.queryParams != null ? new ArrayList<>(this.queryParams) : Collections.<NameValuePair>emptyList();
+ return this.queryParams != null ? new ArrayList<>(this.queryParams) : Collections.emptyList();
}
/**
diff --git a/httpcore5/src/test/java/org/apache/hc/core5/http/NameValuePairListMatcher.java b/httpcore5/src/test/java/org/apache/hc/core5/http/NameValuePairListMatcher.java
index 16c804d..ffc1c56 100644
--- a/httpcore5/src/test/java/org/apache/hc/core5/http/NameValuePairListMatcher.java
+++ b/httpcore5/src/test/java/org/apache/hc/core5/http/NameValuePairListMatcher.java
@@ -79,7 +79,7 @@
@Factory
public static Matcher<List<NameValuePair>> isEmpty() {
- return new NameValuePairListMatcher(Collections.<NameValuePair>emptyList());
+ return new NameValuePairListMatcher(Collections.emptyList());
}
}
diff --git a/httpcore5/src/test/java/org/apache/hc/core5/http/impl/io/TestBHttpConnectionBase.java b/httpcore5/src/test/java/org/apache/hc/core5/http/impl/io/TestBHttpConnectionBase.java
index e098c33..fc0cdb4 100644
--- a/httpcore5/src/test/java/org/apache/hc/core5/http/impl/io/TestBHttpConnectionBase.java
+++ b/httpcore5/src/test/java/org/apache/hc/core5/http/impl/io/TestBHttpConnectionBase.java
@@ -115,13 +115,13 @@
Assert.assertFalse(conn.isOpen());
Mockito.verify(outStream, Mockito.times(1)).write(
- ArgumentMatchers.<byte[]>any(), ArgumentMatchers.anyInt(), ArgumentMatchers.anyInt());
+ ArgumentMatchers.any(), ArgumentMatchers.anyInt(), ArgumentMatchers.anyInt());
Mockito.verify(socket, Mockito.times(1)).close();
conn.close();
Mockito.verify(socket, Mockito.times(1)).close();
Mockito.verify(outStream, Mockito.times(1)).write(
- ArgumentMatchers.<byte[]>any(), ArgumentMatchers.anyInt(), ArgumentMatchers.anyInt());
+ ArgumentMatchers.any(), ArgumentMatchers.anyInt(), ArgumentMatchers.anyInt());
}
@Test
@@ -142,7 +142,7 @@
Assert.assertFalse(conn.isOpen());
Mockito.verify(outStream, Mockito.never()).write(
- ArgumentMatchers.<byte []>any(), ArgumentMatchers.anyInt(), ArgumentMatchers.anyInt());
+ ArgumentMatchers.any(), ArgumentMatchers.anyInt(), ArgumentMatchers.anyInt());
Mockito.verify(socket, Mockito.never()).shutdownInput();
Mockito.verify(socket, Mockito.never()).shutdownOutput();
Mockito.verify(socket, Mockito.times(1)).close();
@@ -252,7 +252,7 @@
Mockito.verify(socket, Mockito.never()).setSoTimeout(ArgumentMatchers.anyInt());
Mockito.verify(inStream, Mockito.times(1)).read(
- ArgumentMatchers.<byte []>any(), ArgumentMatchers.anyInt(), ArgumentMatchers.anyInt());
+ ArgumentMatchers.any(), ArgumentMatchers.anyInt(), ArgumentMatchers.anyInt());
}
@Test
@@ -270,14 +270,14 @@
Mockito.verify(socket, Mockito.times(1)).setSoTimeout(432);
Mockito.verify(socket, Mockito.times(1)).setSoTimeout(345);
Mockito.verify(inStream, Mockito.times(1)).read(
- ArgumentMatchers.<byte []>any(), ArgumentMatchers.anyInt(), ArgumentMatchers.anyInt());
+ ArgumentMatchers.any(), ArgumentMatchers.anyInt(), ArgumentMatchers.anyInt());
}
@Test
public void testAwaitInputNoData() throws Exception {
final InputStream inStream = Mockito.mock(InputStream.class);
Mockito.when(socket.getInputStream()).thenReturn(inStream);
- Mockito.when(inStream.read(ArgumentMatchers.<byte []>any(), ArgumentMatchers.anyInt(), ArgumentMatchers.anyInt()))
+ Mockito.when(inStream.read(ArgumentMatchers.any(), ArgumentMatchers.anyInt(), ArgumentMatchers.anyInt()))
.thenReturn(-1);
conn.bind(socket);
@@ -314,7 +314,7 @@
public void testStaleWhenEndOfStream() throws Exception {
final InputStream inStream = Mockito.mock(InputStream.class);
Mockito.when(socket.getInputStream()).thenReturn(inStream);
- Mockito.when(inStream.read(ArgumentMatchers.<byte []>any(), ArgumentMatchers.anyInt(), ArgumentMatchers.anyInt()))
+ Mockito.when(inStream.read(ArgumentMatchers.any(), ArgumentMatchers.anyInt(), ArgumentMatchers.anyInt()))
.thenReturn(-1);
conn.bind(socket);
@@ -327,7 +327,7 @@
public void testNotStaleWhenTimeout() throws Exception {
final InputStream inStream = Mockito.mock(InputStream.class);
Mockito.when(socket.getInputStream()).thenReturn(inStream);
- Mockito.when(inStream.read(ArgumentMatchers.<byte []>any(), ArgumentMatchers.anyInt(), ArgumentMatchers.anyInt()))
+ Mockito.when(inStream.read(ArgumentMatchers.any(), ArgumentMatchers.anyInt(), ArgumentMatchers.anyInt()))
.thenThrow(new SocketTimeoutException());
conn.bind(socket);
@@ -340,7 +340,7 @@
public void testStaleWhenIOError() throws Exception {
final InputStream inStream = Mockito.mock(InputStream.class);
Mockito.when(socket.getInputStream()).thenReturn(inStream);
- Mockito.when(inStream.read(ArgumentMatchers.<byte []>any(), ArgumentMatchers.anyInt(), ArgumentMatchers.anyInt()))
+ Mockito.when(inStream.read(ArgumentMatchers.any(), ArgumentMatchers.anyInt(), ArgumentMatchers.anyInt()))
.thenThrow(new SocketException());
conn.bind(socket);
diff --git a/httpcore5/src/test/java/org/apache/hc/core5/http/impl/io/TestHttpService.java b/httpcore5/src/test/java/org/apache/hc/core5/http/impl/io/TestHttpService.java
index 4b75ae6..860d0ce 100644
--- a/httpcore5/src/test/java/org/apache/hc/core5/http/impl/io/TestHttpService.java
+++ b/httpcore5/src/test/java/org/apache/hc/core5/http/impl/io/TestHttpService.java
@@ -317,7 +317,7 @@
Mockito.verify(httprocessor).process(response, response.getEntity(), context);
Mockito.verify(conn).sendResponseHeader(response);
- Mockito.verify(conn, Mockito.never()).sendResponseEntity(ArgumentMatchers.<ClassicHttpResponse>any());
+ Mockito.verify(conn, Mockito.never()).sendResponseEntity(ArgumentMatchers.any());
Mockito.verify(conn).flush();
Mockito.verify(conn, Mockito.never()).close();
Mockito.verify(response).close();
@@ -341,7 +341,7 @@
Mockito.verify(requestHandler).handle(request, response, context);
Mockito.verify(conn).sendResponseHeader(response);
- Mockito.verify(conn, Mockito.never()).sendResponseEntity(ArgumentMatchers.<ClassicHttpResponse>any());
+ Mockito.verify(conn, Mockito.never()).sendResponseEntity(ArgumentMatchers.any());
Mockito.verify(conn).flush();
Mockito.verify(conn, Mockito.never()).close();
Mockito.verify(response).close();
diff --git a/httpcore5/src/test/java/org/apache/hc/core5/http/impl/io/TestSessionInOutBuffers.java b/httpcore5/src/test/java/org/apache/hc/core5/http/impl/io/TestSessionInOutBuffers.java
index 140f5d7..ca3de8e 100644
--- a/httpcore5/src/test/java/org/apache/hc/core5/http/impl/io/TestSessionInOutBuffers.java
+++ b/httpcore5/src/test/java/org/apache/hc/core5/http/impl/io/TestSessionInOutBuffers.java
@@ -377,7 +377,7 @@
outbuffer.write(new byte[] {1, 2}, outputStream);
outbuffer.write(new byte[]{3, 4}, outputStream);
outbuffer.flush(outputStream);
- Mockito.verify(outputStream, Mockito.times(1)).write(ArgumentMatchers.<byte[]>any(), ArgumentMatchers.anyInt(), ArgumentMatchers.anyInt());
+ Mockito.verify(outputStream, Mockito.times(1)).write(ArgumentMatchers.any(), ArgumentMatchers.anyInt(), ArgumentMatchers.anyInt());
Mockito.verify(outputStream, Mockito.never()).write(ArgumentMatchers.anyInt());
}
@@ -389,7 +389,7 @@
outbuffer.write(2, outputStream);
outbuffer.write(new byte[] {1, 2}, outputStream);
outbuffer.write(new byte[]{3, 4}, outputStream);
- Mockito.verify(outputStream, Mockito.times(2)).write(ArgumentMatchers.<byte []>any(), ArgumentMatchers.anyInt(), ArgumentMatchers.anyInt());
+ Mockito.verify(outputStream, Mockito.times(2)).write(ArgumentMatchers.any(), ArgumentMatchers.anyInt(), ArgumentMatchers.anyInt());
Mockito.verify(outputStream, Mockito.times(2)).write(ArgumentMatchers.anyInt());
}
diff --git a/httpcore5/src/test/java/org/apache/hc/core5/http/impl/nio/TestChunkEncoder.java b/httpcore5/src/test/java/org/apache/hc/core5/http/impl/nio/TestChunkEncoder.java
index 4427276..9518e09 100644
--- a/httpcore5/src/test/java/org/apache/hc/core5/http/impl/nio/TestChunkEncoder.java
+++ b/httpcore5/src/test/java/org/apache/hc/core5/http/impl/nio/TestChunkEncoder.java
@@ -128,7 +128,7 @@
Assert.assertEquals(16, encoder.write(CodecTestUtils.wrap("0123456789ABCDEF")));
Assert.assertEquals(16, encoder.write(CodecTestUtils.wrap("0123456789ABCDEF")));
- Mockito.verify(channel, Mockito.never()).write(ArgumentMatchers.<ByteBuffer>any());
+ Mockito.verify(channel, Mockito.never()).write(ArgumentMatchers.any());
outbuf.flush(channel);
final String s = channel.dump(StandardCharsets.US_ASCII);
diff --git a/httpcore5/src/test/java/org/apache/hc/core5/http/impl/nio/TestIdentityEncoder.java b/httpcore5/src/test/java/org/apache/hc/core5/http/impl/nio/TestIdentityEncoder.java
index 1c8c80b..91b05c2 100644
--- a/httpcore5/src/test/java/org/apache/hc/core5/http/impl/nio/TestIdentityEncoder.java
+++ b/httpcore5/src/test/java/org/apache/hc/core5/http/impl/nio/TestIdentityEncoder.java
@@ -318,7 +318,7 @@
final IdentityEncoder encoder = new IdentityEncoder(channel, outbuf, metrics, 0);
Assert.assertEquals(5, encoder.write(CodecTestUtils.wrap("stuff")));
- Mockito.verify(channel, Mockito.times(2)).write(ArgumentMatchers.<ByteBuffer>any());
+ Mockito.verify(channel, Mockito.times(2)).write(ArgumentMatchers.any());
Mockito.verify(outbuf, Mockito.never()).write(ArgumentMatchers.<ByteBuffer>any());
Mockito.verify(outbuf, Mockito.times(1)).flush(channel);
@@ -342,7 +342,7 @@
final IdentityEncoder encoder = new IdentityEncoder(channel, outbuf, metrics, 32);
Assert.assertEquals(5, encoder.write(CodecTestUtils.wrap("stuff")));
- Mockito.verify(channel, Mockito.never()).write(ArgumentMatchers.<ByteBuffer>any());
+ Mockito.verify(channel, Mockito.never()).write(ArgumentMatchers.any());
Mockito.verify(outbuf, Mockito.times(1)).write(ArgumentMatchers.<ByteBuffer>any());
Mockito.verify(outbuf, Mockito.never()).flush(channel);
@@ -365,7 +365,7 @@
Assert.assertEquals(1, encoder.write(CodecTestUtils.wrap("-")));
Assert.assertEquals(10, encoder.write(CodecTestUtils.wrap("more stuff")));
- Mockito.verify(channel, Mockito.never()).write(ArgumentMatchers.<ByteBuffer>any());
+ Mockito.verify(channel, Mockito.never()).write(ArgumentMatchers.any());
Mockito.verify(outbuf, Mockito.times(3)).write(ArgumentMatchers.<ByteBuffer>any());
Mockito.verify(outbuf, Mockito.never()).flush(channel);
@@ -389,7 +389,7 @@
final IdentityEncoder encoder = new IdentityEncoder(channel, outbuf, metrics, 2);
Assert.assertEquals(5, encoder.write(CodecTestUtils.wrap("stuff")));
- Mockito.verify(channel, Mockito.times(2)).write(ArgumentMatchers.<ByteBuffer>any());
+ Mockito.verify(channel, Mockito.times(2)).write(ArgumentMatchers.any());
Mockito.verify(outbuf, Mockito.never()).write(ArgumentMatchers.<ByteBuffer>any());
Mockito.verify(outbuf, Mockito.times(1)).flush(channel);
@@ -413,7 +413,7 @@
Assert.assertEquals(1, encoder.write(CodecTestUtils.wrap("-")));
Assert.assertEquals(10, encoder.write(CodecTestUtils.wrap("more stuff")));
- Mockito.verify(channel, Mockito.times(5)).write(ArgumentMatchers.<ByteBuffer>any());
+ Mockito.verify(channel, Mockito.times(5)).write(ArgumentMatchers.any());
Mockito.verify(outbuf, Mockito.times(3)).write(ArgumentMatchers.<ByteBuffer>any());
Mockito.verify(outbuf, Mockito.times(3)).flush(channel);
@@ -438,7 +438,7 @@
Assert.assertEquals(1, encoder.write(CodecTestUtils.wrap("-")));
Assert.assertEquals(10, encoder.write(CodecTestUtils.wrap("more stuff")));
- Mockito.verify(channel, Mockito.times(4)).write(ArgumentMatchers.<ByteBuffer>any());
+ Mockito.verify(channel, Mockito.times(4)).write(ArgumentMatchers.any());
Mockito.verify(outbuf, Mockito.times(3)).write(ArgumentMatchers.<ByteBuffer>any());
Mockito.verify(outbuf, Mockito.times(2)).flush(channel);
@@ -465,7 +465,7 @@
Assert.assertEquals(2, encoder.write(CodecTestUtils.wrap("--")));
Assert.assertEquals(10, encoder.write(CodecTestUtils.wrap("more stuff")));
- Mockito.verify(channel, Mockito.times(4)).write(ArgumentMatchers.<ByteBuffer>any());
+ Mockito.verify(channel, Mockito.times(4)).write(ArgumentMatchers.any());
Mockito.verify(outbuf, Mockito.times(5)).write(ArgumentMatchers.<ByteBuffer>any());
Mockito.verify(outbuf, Mockito.times(2)).flush(channel);
@@ -487,7 +487,7 @@
Assert.assertEquals(5, encoder.write(CodecTestUtils.wrap("stuff")));
Assert.assertEquals(6, encoder.write(CodecTestUtils.wrap("-stuff")));
- Mockito.verify(channel, Mockito.times(1)).write(ArgumentMatchers.<ByteBuffer>any());
+ Mockito.verify(channel, Mockito.times(1)).write(ArgumentMatchers.any());
Mockito.verify(outbuf, Mockito.times(3)).write(ArgumentMatchers.<ByteBuffer>any());
Mockito.verify(outbuf, Mockito.times(1)).flush(channel);
@@ -510,7 +510,7 @@
Assert.assertEquals(5, encoder.write(CodecTestUtils.wrap("stuff")));
Assert.assertEquals(16, encoder.write(CodecTestUtils.wrap("-much more stuff")));
- Mockito.verify(channel, Mockito.times(2)).write(ArgumentMatchers.<ByteBuffer>any());
+ Mockito.verify(channel, Mockito.times(2)).write(ArgumentMatchers.any());
Mockito.verify(outbuf, Mockito.times(1)).write(ArgumentMatchers.<ByteBuffer>any());
Mockito.verify(outbuf, Mockito.times(1)).flush(channel);
@@ -540,7 +540,7 @@
Assert.assertEquals(0, encoder.write(CodecTestUtils.wrap("-")));
Assert.assertEquals(0, encoder.write(CodecTestUtils.wrap("more stuff")));
- Mockito.verify(channel, Mockito.times(5)).write(ArgumentMatchers.<ByteBuffer>any());
+ Mockito.verify(channel, Mockito.times(5)).write(ArgumentMatchers.any());
Mockito.verify(outbuf, Mockito.times(6)).write(ArgumentMatchers.<ByteBuffer>any());
Mockito.verify(outbuf, Mockito.times(4)).flush(channel);
@@ -565,7 +565,7 @@
Assert.assertEquals(1, encoder.write(CodecTestUtils.wrap("-")));
Assert.assertEquals(1, encoder.write(CodecTestUtils.wrap("much more stuff")));
- Mockito.verify(channel, Mockito.times(3)).write(ArgumentMatchers.<ByteBuffer>any());
+ Mockito.verify(channel, Mockito.times(3)).write(ArgumentMatchers.any());
Mockito.verify(outbuf, Mockito.times(3)).write(ArgumentMatchers.<ByteBuffer>any());
Mockito.verify(outbuf, Mockito.times(1)).flush(channel);
diff --git a/httpcore5/src/test/java/org/apache/hc/core5/http/impl/nio/TestLengthDelimitedEncoder.java b/httpcore5/src/test/java/org/apache/hc/core5/http/impl/nio/TestLengthDelimitedEncoder.java
index be9ff4b..5e80e90 100644
--- a/httpcore5/src/test/java/org/apache/hc/core5/http/impl/nio/TestLengthDelimitedEncoder.java
+++ b/httpcore5/src/test/java/org/apache/hc/core5/http/impl/nio/TestLengthDelimitedEncoder.java
@@ -377,7 +377,7 @@
100, 0);
Assert.assertEquals(5, encoder.write(CodecTestUtils.wrap("stuff")));
- Mockito.verify(channel, Mockito.times(2)).write(ArgumentMatchers.<ByteBuffer>any());
+ Mockito.verify(channel, Mockito.times(2)).write(ArgumentMatchers.any());
Mockito.verify(outbuf, Mockito.never()).write(ArgumentMatchers.<ByteBuffer>any());
Mockito.verify(outbuf, Mockito.times(1)).flush(channel);
@@ -402,7 +402,7 @@
100, 32);
Assert.assertEquals(5, encoder.write(CodecTestUtils.wrap("stuff")));
- Mockito.verify(channel, Mockito.never()).write(ArgumentMatchers.<ByteBuffer>any());
+ Mockito.verify(channel, Mockito.never()).write(ArgumentMatchers.any());
Mockito.verify(outbuf, Mockito.times(1)).write(ArgumentMatchers.<ByteBuffer>any());
Mockito.verify(outbuf, Mockito.never()).flush(channel);
@@ -426,7 +426,7 @@
Assert.assertEquals(1, encoder.write(CodecTestUtils.wrap("-")));
Assert.assertEquals(10, encoder.write(CodecTestUtils.wrap("more stuff")));
- Mockito.verify(channel, Mockito.never()).write(ArgumentMatchers.<ByteBuffer>any());
+ Mockito.verify(channel, Mockito.never()).write(ArgumentMatchers.any());
Mockito.verify(outbuf, Mockito.times(3)).write(ArgumentMatchers.<ByteBuffer>any());
Mockito.verify(outbuf, Mockito.never()).flush(channel);
@@ -450,7 +450,7 @@
Assert.assertEquals(1, encoder.write(CodecTestUtils.wrap("-")));
Assert.assertEquals(10, encoder.write(CodecTestUtils.wrap("more stuff; and a lot more stuff")));
- Mockito.verify(channel, Mockito.never()).write(ArgumentMatchers.<ByteBuffer>any());
+ Mockito.verify(channel, Mockito.never()).write(ArgumentMatchers.any());
Mockito.verify(outbuf, Mockito.times(3)).write(ArgumentMatchers.<ByteBuffer>any());
Mockito.verify(outbuf, Mockito.never()).flush(channel);
@@ -475,7 +475,7 @@
100, 2);
Assert.assertEquals(5, encoder.write(CodecTestUtils.wrap("stuff")));
- Mockito.verify(channel, Mockito.times(2)).write(ArgumentMatchers.<ByteBuffer>any());
+ Mockito.verify(channel, Mockito.times(2)).write(ArgumentMatchers.any());
Mockito.verify(outbuf, Mockito.never()).write(ArgumentMatchers.<ByteBuffer>any());
Mockito.verify(outbuf, Mockito.times(1)).flush(channel);
@@ -500,7 +500,7 @@
Assert.assertEquals(1, encoder.write(CodecTestUtils.wrap("-")));
Assert.assertEquals(10, encoder.write(CodecTestUtils.wrap("more stuff")));
- Mockito.verify(channel, Mockito.times(5)).write(ArgumentMatchers.<ByteBuffer>any());
+ Mockito.verify(channel, Mockito.times(5)).write(ArgumentMatchers.any());
Mockito.verify(outbuf, Mockito.times(3)).write(ArgumentMatchers.<ByteBuffer>any());
Mockito.verify(outbuf, Mockito.times(3)).flush(channel);
@@ -526,7 +526,7 @@
Assert.assertEquals(1, encoder.write(CodecTestUtils.wrap("-")));
Assert.assertEquals(10, encoder.write(CodecTestUtils.wrap("more stuff")));
- Mockito.verify(channel, Mockito.times(4)).write(ArgumentMatchers.<ByteBuffer>any());
+ Mockito.verify(channel, Mockito.times(4)).write(ArgumentMatchers.any());
Mockito.verify(outbuf, Mockito.times(3)).write(ArgumentMatchers.<ByteBuffer>any());
Mockito.verify(outbuf, Mockito.times(2)).flush(channel);
@@ -554,7 +554,7 @@
Assert.assertEquals(2, encoder.write(CodecTestUtils.wrap("--")));
Assert.assertEquals(10, encoder.write(CodecTestUtils.wrap("more stuff")));
- Mockito.verify(channel, Mockito.times(4)).write(ArgumentMatchers.<ByteBuffer>any());
+ Mockito.verify(channel, Mockito.times(4)).write(ArgumentMatchers.any());
Mockito.verify(outbuf, Mockito.times(5)).write(ArgumentMatchers.<ByteBuffer>any());
Mockito.verify(outbuf, Mockito.times(2)).flush(channel);
@@ -577,7 +577,7 @@
Assert.assertEquals(5, encoder.write(CodecTestUtils.wrap("stuff")));
Assert.assertEquals(6, encoder.write(CodecTestUtils.wrap("-stuff")));
- Mockito.verify(channel, Mockito.times(1)).write(ArgumentMatchers.<ByteBuffer>any());
+ Mockito.verify(channel, Mockito.times(1)).write(ArgumentMatchers.any());
Mockito.verify(outbuf, Mockito.times(3)).write(ArgumentMatchers.<ByteBuffer>any());
Mockito.verify(outbuf, Mockito.times(1)).flush(channel);
@@ -601,7 +601,7 @@
Assert.assertEquals(5, encoder.write(CodecTestUtils.wrap("stuff")));
Assert.assertEquals(16, encoder.write(CodecTestUtils.wrap("-much more stuff")));
- Mockito.verify(channel, Mockito.times(2)).write(ArgumentMatchers.<ByteBuffer>any());
+ Mockito.verify(channel, Mockito.times(2)).write(ArgumentMatchers.any());
Mockito.verify(outbuf, Mockito.times(1)).write(ArgumentMatchers.<ByteBuffer>any());
Mockito.verify(outbuf, Mockito.times(1)).flush(channel);
@@ -632,7 +632,7 @@
Assert.assertEquals(0, encoder.write(CodecTestUtils.wrap("-")));
Assert.assertEquals(0, encoder.write(CodecTestUtils.wrap("more stuff")));
- Mockito.verify(channel, Mockito.times(5)).write(ArgumentMatchers.<ByteBuffer>any());
+ Mockito.verify(channel, Mockito.times(5)).write(ArgumentMatchers.any());
Mockito.verify(outbuf, Mockito.times(6)).write(ArgumentMatchers.<ByteBuffer>any());
Mockito.verify(outbuf, Mockito.times(4)).flush(channel);
@@ -658,7 +658,7 @@
Assert.assertEquals(1, encoder.write(CodecTestUtils.wrap("-")));
Assert.assertEquals(1, encoder.write(CodecTestUtils.wrap("much more stuff")));
- Mockito.verify(channel, Mockito.times(3)).write(ArgumentMatchers.<ByteBuffer>any());
+ Mockito.verify(channel, Mockito.times(3)).write(ArgumentMatchers.any());
Mockito.verify(outbuf, Mockito.times(3)).write(ArgumentMatchers.<ByteBuffer>any());
Mockito.verify(outbuf, Mockito.times(1)).flush(channel);
diff --git a/httpcore5/src/test/java/org/apache/hc/core5/http/io/TestEofSensorInputStream.java b/httpcore5/src/test/java/org/apache/hc/core5/http/io/TestEofSensorInputStream.java
index 52d5733..50845ac 100644
--- a/httpcore5/src/test/java/org/apache/hc/core5/http/io/TestEofSensorInputStream.java
+++ b/httpcore5/src/test/java/org/apache/hc/core5/http/io/TestEofSensorInputStream.java
@@ -50,7 +50,7 @@
@Test
public void testClose() throws Exception {
- Mockito.when(eofwatcher.streamClosed(Mockito.<InputStream>any())).thenReturn(Boolean.TRUE);
+ Mockito.when(eofwatcher.streamClosed(Mockito.any())).thenReturn(Boolean.TRUE);
eofstream.close();
@@ -65,7 +65,7 @@
@Test
public void testCloseIOError() throws Exception {
- Mockito.when(eofwatcher.streamClosed(Mockito.<InputStream>any())).thenThrow(new IOException());
+ Mockito.when(eofwatcher.streamClosed(Mockito.any())).thenThrow(new IOException());
try {
eofstream.close();
@@ -80,7 +80,7 @@
@Test
public void testReleaseConnection() throws Exception {
- Mockito.when(eofwatcher.streamClosed(Mockito.<InputStream>any())).thenReturn(Boolean.TRUE);
+ Mockito.when(eofwatcher.streamClosed(Mockito.any())).thenReturn(Boolean.TRUE);
eofstream.close();
@@ -95,7 +95,7 @@
@Test
public void testAbortConnection() throws Exception {
- Mockito.when(eofwatcher.streamAbort(Mockito.<InputStream>any())).thenReturn(Boolean.TRUE);
+ Mockito.when(eofwatcher.streamAbort(Mockito.any())).thenReturn(Boolean.TRUE);
eofstream.abort();
@@ -110,7 +110,7 @@
@Test
public void testAbortConnectionIOError() throws Exception {
- Mockito.when(eofwatcher.streamAbort(Mockito.<InputStream>any())).thenThrow(new IOException());
+ Mockito.when(eofwatcher.streamAbort(Mockito.any())).thenThrow(new IOException());
try {
eofstream.abort();
@@ -125,7 +125,7 @@
@Test
public void testRead() throws Exception {
- Mockito.when(eofwatcher.eofDetected(Mockito.<InputStream>any())).thenReturn(Boolean.TRUE);
+ Mockito.when(eofwatcher.eofDetected(Mockito.any())).thenReturn(Boolean.TRUE);
Mockito.when(inStream.read()).thenReturn(0, -1);
Assert.assertEquals(0, eofstream.read());
@@ -148,7 +148,7 @@
@Test
public void testReadIOError() throws Exception {
- Mockito.when(eofwatcher.eofDetected(Mockito.<InputStream>any())).thenReturn(Boolean.TRUE);
+ Mockito.when(eofwatcher.eofDetected(Mockito.any())).thenReturn(Boolean.TRUE);
Mockito.when(inStream.read()).thenThrow(new IOException());
try {
@@ -164,8 +164,8 @@
@Test
public void testReadByteArray() throws Exception {
- Mockito.when(eofwatcher.eofDetected(Mockito.<InputStream>any())).thenReturn(Boolean.TRUE);
- Mockito.when(inStream.read(Mockito.<byte []>any(), Mockito.anyInt(), Mockito.anyInt()))
+ Mockito.when(eofwatcher.eofDetected(Mockito.any())).thenReturn(Boolean.TRUE);
+ Mockito.when(inStream.read(Mockito.any(), Mockito.anyInt(), Mockito.anyInt()))
.thenReturn(1, -1);
final byte[] tmp = new byte[1];
@@ -190,8 +190,8 @@
@Test
public void testReadByteArrayIOError() throws Exception {
- Mockito.when(eofwatcher.eofDetected(Mockito.<InputStream>any())).thenReturn(Boolean.TRUE);
- Mockito.when(inStream.read(Mockito.<byte []>any(), Mockito.anyInt(), Mockito.anyInt()))
+ Mockito.when(eofwatcher.eofDetected(Mockito.any())).thenReturn(Boolean.TRUE);
+ Mockito.when(inStream.read(Mockito.any(), Mockito.anyInt(), Mockito.anyInt()))
.thenThrow(new IOException());
final byte[] tmp = new byte[1];
@@ -208,7 +208,7 @@
@Test
public void testReadAfterAbort() throws Exception {
- Mockito.when(eofwatcher.streamAbort(Mockito.<InputStream>any())).thenReturn(Boolean.TRUE);
+ Mockito.when(eofwatcher.streamAbort(Mockito.any())).thenReturn(Boolean.TRUE);
eofstream.abort();
diff --git a/httpcore5/src/test/java/org/apache/hc/core5/net/TestURIBuilder.java b/httpcore5/src/test/java/org/apache/hc/core5/net/TestURIBuilder.java
index 6bd189a..e38578c 100644
--- a/httpcore5/src/test/java/org/apache/hc/core5/net/TestURIBuilder.java
+++ b/httpcore5/src/test/java/org/apache/hc/core5/net/TestURIBuilder.java
@@ -360,7 +360,7 @@
@Test
public void testSetParametersWithEmptyList() throws Exception {
final URI uri = new URI("http", null, "localhost", 80, "/test", "param=test", null);
- final URIBuilder uribuilder = new URIBuilder(uri).setParameters(Collections.<NameValuePair>emptyList());
+ final URIBuilder uribuilder = new URIBuilder(uri).setParameters(Collections.emptyList());
final URI result = uribuilder.build();
Assert.assertEquals(new URI("http://localhost:80/test"), result);
}
diff --git a/httpcore5/src/test/java/org/apache/hc/core5/pool/TestLaxConnPool.java b/httpcore5/src/test/java/org/apache/hc/core5/pool/TestLaxConnPool.java
index db64b55..e2fd951 100644
--- a/httpcore5/src/test/java/org/apache/hc/core5/pool/TestLaxConnPool.java
+++ b/httpcore5/src/test/java/org/apache/hc/core5/pool/TestLaxConnPool.java
@@ -91,8 +91,8 @@
pool.release(entry1, true);
pool.release(entry2, true);
pool.release(entry3, false);
- Mockito.verify(conn1, Mockito.never()).close(ArgumentMatchers.<CloseMode>any());
- Mockito.verify(conn2, Mockito.never()).close(ArgumentMatchers.<CloseMode>any());
+ Mockito.verify(conn1, Mockito.never()).close(ArgumentMatchers.any());
+ Mockito.verify(conn2, Mockito.never()).close(ArgumentMatchers.any());
Mockito.verify(conn3, Mockito.times(1)).close(CloseMode.GRACEFUL);
final PoolStats totals = pool.getTotalStats();
@@ -259,7 +259,7 @@
pool.closeExpired();
Mockito.verify(conn1).close(CloseMode.GRACEFUL);
- Mockito.verify(conn2, Mockito.never()).close(ArgumentMatchers.<CloseMode>any());
+ Mockito.verify(conn2, Mockito.never()).close(ArgumentMatchers.any());
final PoolStats totals = pool.getTotalStats();
Assert.assertEquals(1, totals.getAvailable());
@@ -301,7 +301,7 @@
pool.closeIdle(TimeValue.of(50, TimeUnit.MILLISECONDS));
Mockito.verify(conn1).close(CloseMode.GRACEFUL);
- Mockito.verify(conn2, Mockito.never()).close(ArgumentMatchers.<CloseMode>any());
+ Mockito.verify(conn2, Mockito.never()).close(ArgumentMatchers.any());
PoolStats totals = pool.getTotalStats();
Assert.assertEquals(1, totals.getAvailable());
diff --git a/httpcore5/src/test/java/org/apache/hc/core5/pool/TestStrictConnPool.java b/httpcore5/src/test/java/org/apache/hc/core5/pool/TestStrictConnPool.java
index 687b714..1a62cf0 100644
--- a/httpcore5/src/test/java/org/apache/hc/core5/pool/TestStrictConnPool.java
+++ b/httpcore5/src/test/java/org/apache/hc/core5/pool/TestStrictConnPool.java
@@ -100,8 +100,8 @@
pool.release(entry1, true);
pool.release(entry2, true);
pool.release(entry3, false);
- Mockito.verify(conn1, Mockito.never()).close(ArgumentMatchers.<CloseMode>any());
- Mockito.verify(conn2, Mockito.never()).close(ArgumentMatchers.<CloseMode>any());
+ Mockito.verify(conn1, Mockito.never()).close(ArgumentMatchers.any());
+ Mockito.verify(conn2, Mockito.never()).close(ArgumentMatchers.any());
Mockito.verify(conn3, Mockito.times(1)).close(CloseMode.GRACEFUL);
final PoolStats totals = pool.getTotalStats();
@@ -354,7 +354,7 @@
Assert.assertTrue(future5.isDone());
Mockito.verify(conn2).close(CloseMode.GRACEFUL);
- Mockito.verify(conn1, Mockito.never()).close(ArgumentMatchers.<CloseMode>any());
+ Mockito.verify(conn1, Mockito.never()).close(ArgumentMatchers.any());
totals = pool.getTotalStats();
Assert.assertEquals(1, totals.getAvailable());
@@ -424,7 +424,7 @@
pool.closeExpired();
Mockito.verify(conn1).close(CloseMode.GRACEFUL);
- Mockito.verify(conn2, Mockito.never()).close(ArgumentMatchers.<CloseMode>any());
+ Mockito.verify(conn2, Mockito.never()).close(ArgumentMatchers.any());
final PoolStats totals = pool.getTotalStats();
Assert.assertEquals(1, totals.getAvailable());
@@ -466,7 +466,7 @@
pool.closeIdle(TimeValue.of(50, TimeUnit.MILLISECONDS));
Mockito.verify(conn1).close(CloseMode.GRACEFUL);
- Mockito.verify(conn2, Mockito.never()).close(ArgumentMatchers.<CloseMode>any());
+ Mockito.verify(conn2, Mockito.never()).close(ArgumentMatchers.any());
PoolStats totals = pool.getTotalStats();
Assert.assertEquals(1, totals.getAvailable());
diff --git a/httpcore5/src/test/java/org/apache/hc/core5/reactor/TestAbstractIOSessionPool.java b/httpcore5/src/test/java/org/apache/hc/core5/reactor/TestAbstractIOSessionPool.java
index 56550d6..04f3dd4 100644
--- a/httpcore5/src/test/java/org/apache/hc/core5/reactor/TestAbstractIOSessionPool.java
+++ b/httpcore5/src/test/java/org/apache/hc/core5/reactor/TestAbstractIOSessionPool.java
@@ -72,14 +72,14 @@
Mockito.when(impl.connectSession(
ArgumentMatchers.anyString(),
- ArgumentMatchers.<Timeout>any(),
- ArgumentMatchers.<FutureCallback<IOSession>>any())).thenReturn(connectFuture);
+ ArgumentMatchers.any(),
+ ArgumentMatchers.any())).thenReturn(connectFuture);
Mockito.doAnswer(invocation -> {
final Callback<Boolean> callback = invocation.getArgument(1);
callback.execute(true);
return null;
- }).when(impl).validateSession(ArgumentMatchers.<IOSession>any(), ArgumentMatchers.<Callback<Boolean>>any());
+ }).when(impl).validateSession(ArgumentMatchers.any(), ArgumentMatchers.any());
Mockito.when(ioSession1.isOpen()).thenReturn(true);
@@ -91,7 +91,7 @@
Mockito.verify(impl).connectSession(
ArgumentMatchers.eq("somehost"),
ArgumentMatchers.eq(Timeout.ofSeconds(123L)),
- ArgumentMatchers.<FutureCallback<IOSession>>any());
+ ArgumentMatchers.any());
final Future<IOSession> future2 = impl.getSession("somehost", Timeout.ofSeconds(123L), null);
MatcherAssert.assertThat(future2, CoreMatchers.notNullValue());
@@ -100,7 +100,7 @@
Mockito.verify(impl, Mockito.times(1)).connectSession(
ArgumentMatchers.eq("somehost"),
- ArgumentMatchers.<Timeout>any(),
+ ArgumentMatchers.any(),
ArgumentMatchers.argThat(callback -> {
callback.completed(ioSession1);
return true;
@@ -112,16 +112,16 @@
MatcherAssert.assertThat(future2.isDone(), CoreMatchers.equalTo(true));
MatcherAssert.assertThat(future2.get(), CoreMatchers.sameInstance(ioSession1));
- Mockito.verify(impl, Mockito.times(2)).validateSession(ArgumentMatchers.<IOSession>any(), ArgumentMatchers.<Callback<Boolean>>any());
+ Mockito.verify(impl, Mockito.times(2)).validateSession(ArgumentMatchers.any(), ArgumentMatchers.any());
final Future<IOSession> future3 = impl.getSession("somehost", Timeout.ofSeconds(123L), null);
Mockito.verify(impl, Mockito.times(1)).connectSession(
ArgumentMatchers.eq("somehost"),
- ArgumentMatchers.<Timeout>any(),
- ArgumentMatchers.<FutureCallback<IOSession>>any());
+ ArgumentMatchers.any(),
+ ArgumentMatchers.any());
- Mockito.verify(impl, Mockito.times(3)).validateSession(ArgumentMatchers.<IOSession>any(), ArgumentMatchers.<Callback<Boolean>>any());
+ Mockito.verify(impl, Mockito.times(3)).validateSession(ArgumentMatchers.any(), ArgumentMatchers.any());
MatcherAssert.assertThat(future3.isDone(), CoreMatchers.equalTo(true));
MatcherAssert.assertThat(future3.get(), CoreMatchers.sameInstance(ioSession1));
@@ -132,8 +132,8 @@
Mockito.when(impl.connectSession(
ArgumentMatchers.anyString(),
- ArgumentMatchers.<Timeout>any(),
- ArgumentMatchers.<FutureCallback<IOSession>>any())).thenReturn(connectFuture);
+ ArgumentMatchers.any(),
+ ArgumentMatchers.any())).thenReturn(connectFuture);
final Future<IOSession> future1 = impl.getSession("somehost", Timeout.ofSeconds(123L), null);
MatcherAssert.assertThat(future1, CoreMatchers.notNullValue());
@@ -143,7 +143,7 @@
Mockito.verify(impl).connectSession(
ArgumentMatchers.eq("somehost"),
ArgumentMatchers.eq(Timeout.ofSeconds(123L)),
- ArgumentMatchers.<FutureCallback<IOSession>>any());
+ ArgumentMatchers.any());
final Future<IOSession> future2 = impl.getSession("somehost", Timeout.ofSeconds(123L), null);
MatcherAssert.assertThat(future2, CoreMatchers.notNullValue());
@@ -152,7 +152,7 @@
Mockito.verify(impl, Mockito.times(1)).connectSession(
ArgumentMatchers.eq("somehost"),
- ArgumentMatchers.<Timeout>any(),
+ ArgumentMatchers.any(),
ArgumentMatchers.argThat(callback -> {
callback.failed(new Exception("Boom"));
return true;
@@ -232,14 +232,14 @@
final Callback<Boolean> callback = invocation.getArgument(1);
callback.execute(false);
return null;
- }).when(impl).validateSession(ArgumentMatchers.<IOSession>any(), ArgumentMatchers.<Callback<Boolean>>any());
+ }).when(impl).validateSession(ArgumentMatchers.any(), ArgumentMatchers.any());
impl.getSession("somehost", Timeout.ofSeconds(123L), null);
Mockito.verify(impl, Mockito.times(1)).connectSession(
ArgumentMatchers.eq("somehost"),
ArgumentMatchers.eq(Timeout.ofSeconds(123L)),
- ArgumentMatchers.<FutureCallback<IOSession>>any());
+ ArgumentMatchers.any());
}
@Test
@@ -255,7 +255,7 @@
Mockito.verify(impl).connectSession(
ArgumentMatchers.eq("somehost"),
ArgumentMatchers.eq(Timeout.ofSeconds(123L)),
- ArgumentMatchers.<FutureCallback<IOSession>>any());
+ ArgumentMatchers.any());
}
}