Use diamond operator where feasible

See gh-31916
This commit is contained in:
Yanming Zhou
2023-12-28 15:25:18 +08:00
committed by Stéphane Nicoll
parent db2c532c07
commit 094479b55f
22 changed files with 54 additions and 35 deletions

View File

@@ -56,7 +56,8 @@ public class MultipartBodyBuilderTests {
Publisher<String> publisher = Flux.just("foo", "bar", "baz");
builder.asyncPart("publisherClass", publisher, String.class).header("baz", "qux");
builder.asyncPart("publisherPtr", publisher, new ParameterizedTypeReference<String>() {}).header("baz", "qux");
builder.asyncPart("publisherPtr", publisher, new ParameterizedTypeReference<>() {
}).header("baz", "qux");
MultiValueMap<String, HttpEntity<?>> result = builder.build();

View File

@@ -169,7 +169,8 @@ class ChannelSendOperatorTests {
return Mono.never();
});
operator.subscribe(new BaseSubscriber<Void>() {});
operator.subscribe(new BaseSubscriber<>() {
});
try {
writeSubscriber.signalDemand(1); // Let cached signals ("foo" and error) be published..
}

View File

@@ -166,7 +166,8 @@ class RestClientIntegrationTests {
ValueContainer<Pojo> result = this.restClient.get()
.uri("/json").accept(MediaType.APPLICATION_JSON)
.retrieve()
.body(new ParameterizedTypeReference<ValueContainer<Pojo>>() {});
.body(new ParameterizedTypeReference<>() {
});
assertThat(result.getContainerValue()).isNotNull();
Pojo pojo = result.getContainerValue();
@@ -191,7 +192,8 @@ class RestClientIntegrationTests {
ValueContainer<List<Pojo>> result = this.restClient.get()
.uri("/json").accept(MediaType.APPLICATION_JSON)
.retrieve()
.body(new ParameterizedTypeReference<ValueContainer<List<Pojo>>>() {});
.body(new ParameterizedTypeReference<>() {
});
assertThat(result.containerValue).isNotNull();
assertThat(result.containerValue).containsExactly(new Pojo("foofoo", "barbar"));