Skip to content

Commit bbfc47f

Browse files
strangelookingnerdok2c
authored andcommitted
Minor code cleanup
1 parent ad1a20f commit bbfc47f

File tree

8 files changed

+13
-20
lines changed

8 files changed

+13
-20
lines changed

httpcore5-testing/src/test/java/org/apache/hc/core5/testing/compatibility/http2/H2CompatibilityTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public static void main(final String... args) throws Exception {
9696
}
9797
}
9898

99-
H2CompatibilityTest() throws Exception {
99+
H2CompatibilityTest() {
100100
this.client = H2RequesterBootstrap.bootstrap()
101101
.setIOReactorConfig(IOReactorConfig.custom()
102102
.setSoTimeout(TIMEOUT)
@@ -113,11 +113,11 @@ public static void main(final String... args) throws Exception {
113113
.create();
114114
}
115115

116-
void start() throws Exception {
116+
void start() {
117117
client.start();
118118
}
119119

120-
void shutdown() throws Exception {
120+
void shutdown() {
121121
client.close(CloseMode.GRACEFUL);
122122
}
123123

httpcore5-testing/src/test/java/org/apache/hc/core5/testing/extension/nio/H2AsyncServerResource.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727

2828
package org.apache.hc.core5.testing.extension.nio;
2929

30-
import java.io.IOException;
3130
import java.util.function.Consumer;
3231

3332
import org.apache.hc.core5.http.impl.bootstrap.HttpAsyncServer;
@@ -85,7 +84,7 @@ public void afterEach(final ExtensionContext extensionContext) throws Exception
8584
}
8685
}
8786

88-
public HttpAsyncServer start() throws IOException {
87+
public HttpAsyncServer start() {
8988
Assertions.assertNotNull(server);
9089
server.start();
9190
return server;

httpcore5-testing/src/test/java/org/apache/hc/core5/testing/extension/nio/HttpAsyncServerResource.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727

2828
package org.apache.hc.core5.testing.extension.nio;
2929

30-
import java.io.IOException;
3130
import java.util.function.Consumer;
3231

3332
import org.apache.hc.core5.http.impl.bootstrap.AsyncServerBootstrap;
@@ -83,7 +82,7 @@ public void afterEach(final ExtensionContext extensionContext) throws Exception
8382
}
8483
}
8584

86-
public HttpAsyncServer start() throws IOException {
85+
public HttpAsyncServer start() {
8786
Assertions.assertNotNull(server);
8887
server.start();
8988
return server;

httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/AsyncServerBootstrapFilterTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public void pushPromise(
105105
})));
106106

107107
@RegisterExtension
108-
private final HttpAsyncRequesterResource clientResource = new HttpAsyncRequesterResource((bootstrap) -> bootstrap
108+
private final HttpAsyncRequesterResource clientResource = new HttpAsyncRequesterResource(bootstrap -> bootstrap
109109
.setIOReactorConfig(IOReactorConfig.custom()
110110
.setSoTimeout(TIMEOUT)
111111
.build()));

httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/H2ConnPoolTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
package org.apache.hc.core5.testing.nio;
2929

3030
import java.net.InetSocketAddress;
31-
import java.util.concurrent.ConcurrentLinkedQueue;
3231
import java.util.concurrent.CountDownLatch;
3332
import java.util.concurrent.Future;
3433
import java.util.concurrent.atomic.AtomicLong;
@@ -155,7 +154,7 @@ void testManyGetSessionFailures() throws Exception {
155154
final H2MultiplexingRequester requester = clientResource.start();
156155
final H2ConnPool connPool = requester.getConnPool();
157156
final CountDownLatch latch = new CountDownLatch(n);
158-
final ConcurrentLinkedQueue<Long> concurrentConnections = new ConcurrentLinkedQueue<>();
157+
159158
for (int i = 0; i < n; i++) {
160159
connPool.getSession(target, TIMEOUT, new FutureCallback<IOSession>() {
161160

httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/H2ServerBootstrapFiltersTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ abstract class H2ServerBootstrapFiltersTest {
7070
private static final Timeout TIMEOUT = Timeout.ofMinutes(1);
7171

7272
@RegisterExtension
73-
private final H2AsyncServerResource serverResource = new H2AsyncServerResource((bootstrap) -> bootstrap
73+
private final H2AsyncServerResource serverResource = new H2AsyncServerResource(bootstrap -> bootstrap
7474
.setVersionPolicy(HttpVersionPolicy.NEGOTIATE)
7575
.setIOReactorConfig(
7676
IOReactorConfig.custom()

httpcore5/src/test/java/org/apache/hc/core5/http/message/TestHeaderElement.java

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,8 @@ class TestHeaderElement {
4141
@Test
4242
void testConstructor3() {
4343
final HeaderElement element = new BasicHeaderElement("name", "value",
44-
new NameValuePair[] {
45-
new BasicNameValuePair("param1", "value1"),
46-
new BasicNameValuePair("param2", "value2")
47-
} );
44+
new BasicNameValuePair("param1", "value1"),
45+
new BasicNameValuePair("param2", "value2"));
4846
Assertions.assertEquals("name", element.getName());
4947
Assertions.assertEquals("value", element.getValue());
5048
Assertions.assertEquals(2, element.getParameters().length);
@@ -82,10 +80,8 @@ void testParamByName() {
8280
@Test
8381
void testToString() {
8482
final BasicHeaderElement element = new BasicHeaderElement("name", "value",
85-
new NameValuePair[] {
86-
new BasicNameValuePair("param1", "value1"),
87-
new BasicNameValuePair("param2", "value2")
88-
} );
83+
new BasicNameValuePair("param1", "value1"),
84+
new BasicNameValuePair("param2", "value2"));
8985
Assertions.assertEquals("name=value; param1=value1; param2=value2", element.toString());
9086
}
9187

httpcore5/src/test/java/org/apache/hc/core5/http/protocol/TestStandardInterceptors.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -986,7 +986,7 @@ void testRequestHttpHostHeaderNoPort() throws Exception {
986986
}
987987

988988
@Test
989-
void testRequestHttp11HostHeaderPresent() {
989+
void testRequestHttp11HostHeaderPresent() throws Exception {
990990
final HttpCoreContext context = HttpCoreContext.create();
991991
final BasicClassicHttpRequest request = new BasicClassicHttpRequest(Method.GET, "/");
992992
request.setHeader(HttpHeaders.HOST, "blah");

0 commit comments

Comments
 (0)