Polish "Use diamond operator where feasible"

See gh-31916
This commit is contained in:
Stéphane Nicoll
2023-12-28 13:08:24 +01:00
parent 094479b55f
commit a6e87b40c7
17 changed files with 21 additions and 41 deletions

View File

@@ -60,8 +60,7 @@ class DefaultEntityResponseBuilderTests {
void fromObjectTypeReference() {
String body = "foo";
EntityResponse<String> response = EntityResponse.fromObject(body,
new ParameterizedTypeReference<>() {
})
new ParameterizedTypeReference<>() {})
.build();
assertThat(response.entity()).isSameAs(body);

View File

@@ -265,8 +265,7 @@ class DefaultServerRequestTests {
DefaultServerRequest request = new DefaultServerRequest(servletRequest,
List.of(new MappingJackson2HttpMessageConverter()));
List<String> result = request.body(new ParameterizedTypeReference<>() {
});
List<String> result = request.body(new ParameterizedTypeReference<>() {});
assertThat(result).hasSize(2);
assertThat(result).element(0).isEqualTo("foo");
assertThat(result).element(1).isEqualTo("bar");

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2022 the original author or authors.
* Copyright 2002-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -293,8 +293,7 @@ class DefaultServerResponseBuilderTests {
List<String> body = new ArrayList<>();
body.add("foo");
body.add("bar");
ServerResponse response = ServerResponse.ok().body(body, new ParameterizedTypeReference<>() {
});
ServerResponse response = ServerResponse.ok().body(body, new ParameterizedTypeReference<>() {});
MockHttpServletRequest mockRequest = new MockHttpServletRequest("GET", "https://example.com");
MockHttpServletResponse mockResponse = new MockHttpServletResponse();