Skip to content

Commit 685d67b

Browse files
committed
fix(vertx): Java8 compatibility
Signed-off-by: Marc Nuri <[email protected]>
1 parent 832c138 commit 685d67b

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

Diff for: httpclient-vertx/src/main/java/io/fabric8/kubernetes/client/vertx/VertxHttpRequest.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232

3333
import java.io.InputStream;
3434
import java.nio.ByteBuffer;
35+
import java.util.Collections;
3536
import java.util.LinkedHashMap;
3637
import java.util.List;
3738
import java.util.Map;
@@ -112,7 +113,7 @@ public void cancel() {
112113
};
113114
resp.handler(buffer -> {
114115
try {
115-
consumer.consume(List.of(ByteBuffer.wrap(buffer.getBytes())), result);
116+
consumer.consume(Collections.singletonList(ByteBuffer.wrap(buffer.getBytes())), result);
116117
} catch (Exception e) {
117118
resp.request().reset();
118119
result.done().completeExceptionally(e);

Diff for: httpclient-vertx/src/test/java/io/fabric8/kubernetes/client/vertx/VertxHttpClientBuilderTest.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ void testZeroTimeouts() {
3434
HttpClient.Builder builder = factory.newBuilder();
3535

3636
// should build and be usable without an issue
37-
try (HttpClient client = builder.connectTimeout(0, TimeUnit.MILLISECONDS).build();) {
37+
try (HttpClient client = builder.connectTimeout(0, TimeUnit.MILLISECONDS).build()) {
3838
assertNotNull(client.newHttpRequestBuilder().uri("http://localhost").build());
3939
}
4040
}
@@ -65,7 +65,7 @@ void createsVertxInstanceWhenNoSharedVertx() {
6565
@Test
6666
void doesntCloseSharedVertxInstanceWhenClientIsClosed() {
6767
final Vertx vertx = Vertx.vertx();
68-
final var builder = new VertxHttpClientFactory(vertx).newBuilder();
68+
final VertxHttpClientBuilder<VertxHttpClientFactory> builder = new VertxHttpClientFactory(vertx).newBuilder();
6969
builder.build().close();
7070
assertThat(builder.vertx)
7171
.asInstanceOf(InstanceOfAssertFactories.type(VertxImpl.class))
@@ -75,7 +75,7 @@ void doesntCloseSharedVertxInstanceWhenClientIsClosed() {
7575

7676
@Test
7777
void closesVertxInstanceWhenClientIsClosed() {
78-
final var builder = new VertxHttpClientFactory().newBuilder();
78+
final VertxHttpClientBuilder<VertxHttpClientFactory> builder = new VertxHttpClientFactory().newBuilder();
7979
builder.build().close();
8080
assertThat(builder.vertx)
8181
.asInstanceOf(InstanceOfAssertFactories.type(VertxImpl.class))

0 commit comments

Comments
 (0)