Replace explicit generics with diamond operator

Where possible, explicit generic declarations to use the Java 8 diamond
operator.

See gh-9781
This commit is contained in:
Emanuel Campolo
2017-07-18 11:50:10 -03:00
committed by Phillip Webb
parent eb35fc9fa6
commit 04fdec6f8b
44 changed files with 64 additions and 68 deletions

View File

@@ -64,7 +64,7 @@ public class UserInfoTokenServicesTests {
public void init() {
this.resource.setClientId("foo");
given(this.template.getForEntity(any(String.class), eq(Map.class)))
.willReturn(new ResponseEntity<Map>(this.map, HttpStatus.OK));
.willReturn(new ResponseEntity<>(this.map, HttpStatus.OK));
given(this.template.getAccessToken())
.willReturn(new DefaultOAuth2AccessToken("FOO"));
given(this.template.getResource()).willReturn(this.resource);

View File

@@ -120,7 +120,7 @@ public class ServerPropertiesTests {
@Test
public void redirectContextRootIsNotConfiguredByDefault() throws Exception {
bind(new HashMap<String, String>());
bind(new HashMap<>());
ServerProperties.Tomcat tomcat = this.properties.getTomcat();
assertThat(tomcat.getRedirectContextRoot()).isNull();
}
@@ -164,7 +164,7 @@ public class ServerPropertiesTests {
@Test
public void testCustomizeJettyAccessLog() throws Exception {
Map<String, String> map = new HashMap<String, String>();
Map<String, String> map = new HashMap<>();
map.put("server.jetty.accesslog.enabled", "true");
map.put("server.jetty.accesslog.filename", "foo.txt");
map.put("server.jetty.accesslog.file-date-format", "yyyymmdd");

View File

@@ -107,7 +107,7 @@ public class DefaultServletWebServerFactoryCustomizerTests {
@Test
public void tomcatAccessLogFileDateFormatByDefault() {
TomcatServletWebServerFactory factory = new TomcatServletWebServerFactory();
Map<String, String> map = new HashMap<String, String>();
Map<String, String> map = new HashMap<>();
map.put("server.tomcat.accesslog.enabled", "true");
bindProperties(map);
this.customizer.customize(factory);
@@ -118,7 +118,7 @@ public class DefaultServletWebServerFactoryCustomizerTests {
@Test
public void tomcatAccessLogFileDateFormatCanBeRedefined() {
TomcatServletWebServerFactory factory = new TomcatServletWebServerFactory();
Map<String, String> map = new HashMap<String, String>();
Map<String, String> map = new HashMap<>();
map.put("server.tomcat.accesslog.enabled", "true");
map.put("server.tomcat.accesslog.file-date-format", "yyyy-MM-dd.HH");
bindProperties(map);
@@ -397,7 +397,7 @@ public class DefaultServletWebServerFactoryCustomizerTests {
@Test
public void customTomcatDisableMaxHttpPostSize() {
Map<String, String> map = new HashMap<String, String>();
Map<String, String> map = new HashMap<>();
map.put("server.tomcat.max-http-post-size", "-1");
bindProperties(map);
TomcatServletWebServerFactory factory = new TomcatServletWebServerFactory(0);