diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/ManagementServerProperties.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/ManagementServerProperties.java index b8b10169745..2ec0b4910cf 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/ManagementServerProperties.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/ManagementServerProperties.java @@ -169,7 +169,7 @@ public class ManagementServerProperties implements SecurityPrerequisite { /** * Comma-separated list of roles that can access the management endpoint. */ - private List roles = new ArrayList( + private List roles = new ArrayList<>( Collections.singletonList("ACTUATOR")); /** diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/EnvironmentEndpoint.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/EnvironmentEndpoint.java index 3a8c4cac00a..d34455cf52e 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/EnvironmentEndpoint.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/EnvironmentEndpoint.java @@ -89,7 +89,7 @@ public class EnvironmentEndpoint extends AbstractEndpoint> { } private Map> getPropertySourcesAsMap() { - Map> map = new LinkedHashMap>(); + Map> map = new LinkedHashMap<>(); for (PropertySource source : getPropertySources()) { extract("", map, source); } diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/CompositeHealthIndicator.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/CompositeHealthIndicator.java index 7018ad18cf7..5e5f4c2cbb1 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/CompositeHealthIndicator.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/CompositeHealthIndicator.java @@ -40,7 +40,7 @@ public class CompositeHealthIndicator implements HealthIndicator { * @param healthAggregator the health aggregator */ public CompositeHealthIndicator(HealthAggregator healthAggregator) { - this(healthAggregator, new LinkedHashMap()); + this(healthAggregator, new LinkedHashMap<>()); } /** diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/trace/WebRequestTraceFilter.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/trace/WebRequestTraceFilter.java index 78cf2b56306..f8066711a70 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/trace/WebRequestTraceFilter.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/trace/WebRequestTraceFilter.java @@ -191,7 +191,7 @@ public class WebRequestTraceFilter extends OncePerRequestFilter implements Order } private Map getParameterMapCopy(HttpServletRequest request) { - return new LinkedHashMap(request.getParameterMap()); + return new LinkedHashMap<>(request.getParameterMap()); } /** diff --git a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/CachePublicMetricsTests.java b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/CachePublicMetricsTests.java index 9986fbbe4fc..fbeaac45d1f 100644 --- a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/CachePublicMetricsTests.java +++ b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/CachePublicMetricsTests.java @@ -45,7 +45,7 @@ import static org.assertj.core.api.Assertions.entry; */ public class CachePublicMetricsTests { - private Map cacheManagers = new HashMap(); + private Map cacheManagers = new HashMap<>(); @Before public void setup() { @@ -98,7 +98,7 @@ public class CachePublicMetricsTests { private Map metrics(CachePublicMetrics cpm) { Collection> metrics = cpm.metrics(); assertThat(metrics).isNotNull(); - Map result = new HashMap(); + Map result = new HashMap<>(); for (Metric metric : metrics) { result.put(metric.getName(), metric.getValue()); } diff --git a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/ConfigurationPropertiesReportEndpointSerializationTests.java b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/ConfigurationPropertiesReportEndpointSerializationTests.java index b4a8bdae6a0..37f8da43b56 100644 --- a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/ConfigurationPropertiesReportEndpointSerializationTests.java +++ b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/ConfigurationPropertiesReportEndpointSerializationTests.java @@ -435,9 +435,9 @@ public class ConfigurationPropertiesReportEndpointSerializationTests { public static class InitializedMapAndListProperties extends Foo { - private Map map = new HashMap(); + private Map map = new HashMap<>(); - private List list = new ArrayList(); + private List list = new ArrayList<>(); public Map getMap() { return this.map; diff --git a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/EnvironmentEndpointTests.java b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/EnvironmentEndpointTests.java index 72ec5333fc0..9577dadc267 100644 --- a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/EnvironmentEndpointTests.java +++ b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/EnvironmentEndpointTests.java @@ -268,7 +268,7 @@ public class EnvironmentEndpointTests extends AbstractEndpointTests source = new HashMap(); + Map source = new HashMap<>(); source.put("foo", Collections.singletonMap("bar", "baz")); propertySources.addFirst(new MapPropertySource("test", source)); this.context.register(Config.class); diff --git a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/mvc/EnvironmentMvcEndpointTests.java b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/mvc/EnvironmentMvcEndpointTests.java index fe22fdbc6ae..12572e9f778 100644 --- a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/mvc/EnvironmentMvcEndpointTests.java +++ b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/mvc/EnvironmentMvcEndpointTests.java @@ -142,7 +142,7 @@ public class EnvironmentMvcEndpointTests { @Test public void nestedPathWhenPlaceholderCannotBeResolvedShouldReturnUnresolvedProperty() throws Exception { - Map map = new HashMap(); + Map map = new HashMap<>(); map.put("my.foo", "${my.bar}"); ((ConfigurableEnvironment) this.context.getEnvironment()).getPropertySources() .addFirst(new MapPropertySource("unresolved-placeholder", map)); @@ -152,7 +152,7 @@ public class EnvironmentMvcEndpointTests { @Test public void nestedPathWithSensitivePlaceholderShouldSanitize() throws Exception { - Map map = new HashMap(); + Map map = new HashMap<>(); map.put("my.foo", "${my.password}"); map.put("my.password", "hello"); ((ConfigurableEnvironment) this.context.getEnvironment()).getPropertySources() @@ -165,7 +165,7 @@ public class EnvironmentMvcEndpointTests { public void propertyWithTypeOtherThanStringShouldNotFail() throws Exception { MutablePropertySources propertySources = ((ConfigurableEnvironment) this.context .getEnvironment()).getPropertySources(); - Map source = new HashMap(); + Map source = new HashMap<>(); source.put("foo", Collections.singletonMap("bar", "baz")); propertySources.addFirst(new MapPropertySource("test", source)); this.mvc.perform(get("/application/env/foo.*")).andExpect(status().isOk()) diff --git a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/statsd/StatsdMetricWriterTests.java b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/statsd/StatsdMetricWriterTests.java index 4bd5295825a..936d4586f86 100644 --- a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/statsd/StatsdMetricWriterTests.java +++ b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/statsd/StatsdMetricWriterTests.java @@ -97,7 +97,7 @@ public class StatsdMetricWriterTests { @Test public void incrementMetricWithInvalidCharsInName() throws Exception { - this.writer.increment(new Delta("counter.fo:o", 3L)); + this.writer.increment(new Delta<>("counter.fo:o", 3L)); this.server.waitForMessage(); assertThat(this.server.messagesReceived().get(0)) .isEqualTo("me.counter.fo-o:3|c"); @@ -105,7 +105,7 @@ public class StatsdMetricWriterTests { @Test public void setMetricWithInvalidCharsInName() throws Exception { - this.writer.set(new Metric("gauge.f:o:o", 3L)); + this.writer.set(new Metric<>("gauge.f:o:o", 3L)); this.server.waitForMessage(); assertThat(this.server.messagesReceived().get(0)).isEqualTo("me.gauge.f-o-o:3|g"); } diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/ImportAutoConfigurationImportSelector.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/ImportAutoConfigurationImportSelector.java index 539a7df9297..c3d3ce0675d 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/ImportAutoConfigurationImportSelector.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/ImportAutoConfigurationImportSelector.java @@ -134,7 +134,7 @@ class ImportAutoConfigurationImportSelector extends AutoConfigurationImportSelec AnnotationMetadata metadata) { MultiValueMap, Annotation> annotations = new LinkedMultiValueMap<>(); Class source = ClassUtils.resolveClassName(metadata.getClassName(), null); - collectAnnotations(source, annotations, new HashSet>()); + collectAnnotations(source, annotations, new HashSet<>()); return Collections.unmodifiableMap(annotations); } diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/elasticsearch/jest/JestProperties.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/elasticsearch/jest/JestProperties.java index f4797969c78..2fe572e3d9d 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/elasticsearch/jest/JestProperties.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/elasticsearch/jest/JestProperties.java @@ -34,7 +34,7 @@ public class JestProperties { /** * Comma-separated list of the Elasticsearch instances to use. */ - private List uris = new ArrayList( + private List uris = new ArrayList<>( Collections.singletonList("http://localhost:9200")); /** diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayProperties.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayProperties.java index 5423847ba06..407dac29ed2 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayProperties.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayProperties.java @@ -73,7 +73,7 @@ public class FlywayProperties { * SQL statements to execute to initialize a connection immediately after obtaining * it. */ - private List initSqls = new ArrayList(); + private List initSqls = new ArrayList<>(); public void setLocations(List locations) { this.locations = locations; diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/freemarker/FreeMarkerTemplateAvailabilityProvider.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/freemarker/FreeMarkerTemplateAvailabilityProvider.java index 55849cf9ceb..c917f8633f4 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/freemarker/FreeMarkerTemplateAvailabilityProvider.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/freemarker/FreeMarkerTemplateAvailabilityProvider.java @@ -41,7 +41,7 @@ public class FreeMarkerTemplateAvailabilityProvider static final class FreeMarkerTemplateAvailabilityProperties extends TemplateAvailabilityProperties { - private List templateLoaderPath = new ArrayList( + private List templateLoaderPath = new ArrayList<>( Arrays.asList(FreeMarkerProperties.DEFAULT_TEMPLATE_LOADER_PATH)); FreeMarkerTemplateAvailabilityProperties() { diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/groovy/template/GroovyTemplateAvailabilityProvider.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/groovy/template/GroovyTemplateAvailabilityProvider.java index fbc55fe7f5a..90d39ccea74 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/groovy/template/GroovyTemplateAvailabilityProvider.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/groovy/template/GroovyTemplateAvailabilityProvider.java @@ -41,7 +41,7 @@ public class GroovyTemplateAvailabilityProvider static final class GroovyTemplateAvailabilityProperties extends TemplateAvailabilityProperties { - private List resourceLoaderPath = new ArrayList( + private List resourceLoaderPath = new ArrayList<>( Arrays.asList(GroovyTemplateProperties.DEFAULT_RESOURCE_LOADER_PATH)); GroovyTemplateAvailabilityProperties() { diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/ldap/embedded/EmbeddedLdapAutoConfiguration.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/ldap/embedded/EmbeddedLdapAutoConfiguration.java index e43fd0bf921..c4605e9c101 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/ldap/embedded/EmbeddedLdapAutoConfiguration.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/ldap/embedded/EmbeddedLdapAutoConfiguration.java @@ -181,8 +181,7 @@ public class EmbeddedLdapAutoConfiguration { private Map getLdapPorts(MutablePropertySources sources) { PropertySource propertySource = sources.get(PROPERTY_SOURCE_NAME); if (propertySource == null) { - propertySource = new MapPropertySource(PROPERTY_SOURCE_NAME, - new HashMap()); + propertySource = new MapPropertySource(PROPERTY_SOURCE_NAME, new HashMap<>()); sources.addFirst(propertySource); } return (Map) propertySource.getSource(); diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mongo/embedded/EmbeddedMongoAutoConfiguration.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mongo/embedded/EmbeddedMongoAutoConfiguration.java index 77d1eef6742..725be1bd52a 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mongo/embedded/EmbeddedMongoAutoConfiguration.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mongo/embedded/EmbeddedMongoAutoConfiguration.java @@ -179,8 +179,7 @@ public class EmbeddedMongoAutoConfiguration { private Map getMongoPorts(MutablePropertySources sources) { PropertySource propertySource = sources.get("mongo.ports"); if (propertySource == null) { - propertySource = new MapPropertySource("mongo.ports", - new HashMap()); + propertySource = new MapPropertySource("mongo.ports", new HashMap<>()); sources.addFirst(propertySource); } return (Map) propertySource.getSource(); diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/resource/UserInfoTokenServicesTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/resource/UserInfoTokenServicesTests.java index 4ac1457cb94..a286fb363e4 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/resource/UserInfoTokenServicesTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/resource/UserInfoTokenServicesTests.java @@ -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(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); diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/ServerPropertiesTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/ServerPropertiesTests.java index fc8ea5439a8..95c67693e07 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/ServerPropertiesTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/ServerPropertiesTests.java @@ -120,7 +120,7 @@ public class ServerPropertiesTests { @Test public void redirectContextRootIsNotConfiguredByDefault() throws Exception { - bind(new HashMap()); + 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 map = new HashMap(); + Map 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"); diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/DefaultServletWebServerFactoryCustomizerTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/DefaultServletWebServerFactoryCustomizerTests.java index ff31665c234..b4372cc5e85 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/DefaultServletWebServerFactoryCustomizerTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/DefaultServletWebServerFactoryCustomizerTests.java @@ -107,7 +107,7 @@ public class DefaultServletWebServerFactoryCustomizerTests { @Test public void tomcatAccessLogFileDateFormatByDefault() { TomcatServletWebServerFactory factory = new TomcatServletWebServerFactory(); - Map map = new HashMap(); + Map 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 map = new HashMap(); + Map 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 map = new HashMap(); + Map map = new HashMap<>(); map.put("server.tomcat.max-http-post-size", "-1"); bindProperties(map); TomcatServletWebServerFactory factory = new TomcatServletWebServerFactory(0); diff --git a/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/autoconfigure/DevToolsDataSourceAutoConfiguration.java b/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/autoconfigure/DevToolsDataSourceAutoConfiguration.java index 8ecf52b1bd4..218592072ec 100644 --- a/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/autoconfigure/DevToolsDataSourceAutoConfiguration.java +++ b/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/autoconfigure/DevToolsDataSourceAutoConfiguration.java @@ -126,8 +126,7 @@ public class DevToolsDataSourceAutoConfiguration { InMemoryDatabase(String urlPrefix, String... driverClassNames) { this.urlPrefix = urlPrefix; - this.driverClassNames = new HashSet( - Arrays.asList(driverClassNames)); + this.driverClassNames = new HashSet<>(Arrays.asList(driverClassNames)); } boolean matches(DataSourceProperties properties) { diff --git a/spring-boot-integration-tests/spring-boot-integration-tests-embedded-servlet-container/src/test/java/org/springframework/boot/context/embedded/AbstractEmbeddedServletContainerIntegrationTests.java b/spring-boot-integration-tests/spring-boot-integration-tests-embedded-servlet-container/src/test/java/org/springframework/boot/context/embedded/AbstractEmbeddedServletContainerIntegrationTests.java index 70fb93d2bf9..183490b191a 100644 --- a/spring-boot-integration-tests/spring-boot-integration-tests-embedded-servlet-container/src/test/java/org/springframework/boot/context/embedded/AbstractEmbeddedServletContainerIntegrationTests.java +++ b/spring-boot-integration-tests/spring-boot-integration-tests-embedded-servlet-container/src/test/java/org/springframework/boot/context/embedded/AbstractEmbeddedServletContainerIntegrationTests.java @@ -58,7 +58,7 @@ public abstract class AbstractEmbeddedServletContainerIntegrationTests { private static List createParameters(String packaging, String container, List> applicationLaunchers) { - List parameters = new ArrayList(); + List parameters = new ArrayList<>(); ApplicationBuilder applicationBuilder = new ApplicationBuilder(temporaryFolder, packaging, container); for (Class launcherClass : applicationLaunchers) { diff --git a/spring-boot-integration-tests/spring-boot-integration-tests-embedded-servlet-container/src/test/java/org/springframework/boot/context/embedded/BootRunApplicationLauncher.java b/spring-boot-integration-tests/spring-boot-integration-tests-embedded-servlet-container/src/test/java/org/springframework/boot/context/embedded/BootRunApplicationLauncher.java index f5a87f5b42e..3eb6033d15c 100644 --- a/spring-boot-integration-tests/spring-boot-integration-tests-embedded-servlet-container/src/test/java/org/springframework/boot/context/embedded/BootRunApplicationLauncher.java +++ b/spring-boot-integration-tests/spring-boot-integration-tests-embedded-servlet-container/src/test/java/org/springframework/boot/context/embedded/BootRunApplicationLauncher.java @@ -56,7 +56,7 @@ class BootRunApplicationLauncher extends AbstractApplicationLauncher { if (archive.getName().endsWith(".war")) { populateSrcMainWebapp(); } - List classpath = new ArrayList(); + List classpath = new ArrayList<>(); classpath.add(targetClasses.getAbsolutePath()); for (File dependency : dependencies.listFiles()) { classpath.add(dependency.getAbsolutePath()); diff --git a/spring-boot-integration-tests/spring-boot-integration-tests-embedded-servlet-container/src/test/java/org/springframework/boot/context/embedded/IdeApplicationLauncher.java b/spring-boot-integration-tests/spring-boot-integration-tests-embedded-servlet-container/src/test/java/org/springframework/boot/context/embedded/IdeApplicationLauncher.java index 4bb64855725..949c8cb145a 100644 --- a/spring-boot-integration-tests/spring-boot-integration-tests-embedded-servlet-container/src/test/java/org/springframework/boot/context/embedded/IdeApplicationLauncher.java +++ b/spring-boot-integration-tests/spring-boot-integration-tests-embedded-servlet-container/src/test/java/org/springframework/boot/context/embedded/IdeApplicationLauncher.java @@ -67,7 +67,7 @@ class IdeApplicationLauncher extends AbstractApplicationLauncher { if (archive.getName().endsWith(".war")) { populateSrcMainWebapp(); } - List classpath = new ArrayList(); + List classpath = new ArrayList<>(); classpath.add(targetClasses.getAbsolutePath()); for (File dependency : dependencies.listFiles()) { classpath.add(dependency.getAbsolutePath()); diff --git a/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/properties/AnnotationsPropertySource.java b/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/properties/AnnotationsPropertySource.java index eaba4fc3bf0..bd6696cf8f8 100644 --- a/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/properties/AnnotationsPropertySource.java +++ b/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/properties/AnnotationsPropertySource.java @@ -60,7 +60,7 @@ public class AnnotationsPropertySource extends EnumerablePropertySource private Map getProperties(Class source) { Map properties = new LinkedHashMap<>(); - collectProperties(source, source, properties, new HashSet>()); + collectProperties(source, source, properties, new HashSet<>()); return Collections.unmodifiableMap(properties); } diff --git a/spring-boot-test/src/main/java/org/springframework/boot/test/context/SpringBootTestContextBootstrapper.java b/spring-boot-test/src/main/java/org/springframework/boot/test/context/SpringBootTestContextBootstrapper.java index 3ce6e5f1c6b..88e601b9a6e 100644 --- a/spring-boot-test/src/main/java/org/springframework/boot/test/context/SpringBootTestContextBootstrapper.java +++ b/spring-boot-test/src/main/java/org/springframework/boot/test/context/SpringBootTestContextBootstrapper.java @@ -219,7 +219,7 @@ public class SpringBootTestContextBootstrapper extends DefaultTestContextBootstr ContextConfiguration configuration) { ContextConfigurationAttributes attributes = new ContextConfigurationAttributes( candidateConfig.getTestClass(), configuration); - Set> configurationClasses = new HashSet>( + Set> configurationClasses = new HashSet<>( Arrays.asList(attributes.getClasses())); for (Class candidate : candidateConfig.getClasses()) { if (configurationClasses.contains(candidate)) { diff --git a/spring-boot-test/src/main/java/org/springframework/boot/test/json/DuplicateJsonObjectContextCustomizerFactory.java b/spring-boot-test/src/main/java/org/springframework/boot/test/json/DuplicateJsonObjectContextCustomizerFactory.java index b6abcdc20d1..d83c3e9cf43 100644 --- a/spring-boot-test/src/main/java/org/springframework/boot/test/json/DuplicateJsonObjectContextCustomizerFactory.java +++ b/spring-boot-test/src/main/java/org/springframework/boot/test/json/DuplicateJsonObjectContextCustomizerFactory.java @@ -60,7 +60,7 @@ class DuplicateJsonObjectContextCustomizerFactory implements ContextCustomizerFa } private List findJsonObjects() { - List jsonObjects = new ArrayList(); + List jsonObjects = new ArrayList<>(); try { Enumeration resources = getClass().getClassLoader() .getResources("org/json/JSONObject.class"); diff --git a/spring-boot-test/src/main/java/org/springframework/boot/test/json/JacksonTester.java b/spring-boot-test/src/main/java/org/springframework/boot/test/json/JacksonTester.java index 91c79a1e5a1..ffc6e0df60f 100644 --- a/spring-boot-test/src/main/java/org/springframework/boot/test/json/JacksonTester.java +++ b/spring-boot-test/src/main/java/org/springframework/boot/test/json/JacksonTester.java @@ -158,7 +158,7 @@ public class JacksonTester extends AbstractJsonMarshalTester { * @return the new instance */ public JacksonTester forView(Class view) { - return new JacksonTester(this.getResourceLoadClass(), this.getType(), + return new JacksonTester<>(this.getResourceLoadClass(), this.getType(), this.objectMapper, view); } diff --git a/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootArchiveSupport.java b/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootArchiveSupport.java index 0dabcaf3cfd..10876ea74cf 100644 --- a/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootArchiveSupport.java +++ b/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootArchiveSupport.java @@ -46,7 +46,7 @@ class BootArchiveSupport { private static final Set DEFAULT_LAUNCHER_CLASSES; static { - Set defaultLauncherClasses = new HashSet(); + Set defaultLauncherClasses = new HashSet<>(); defaultLauncherClasses.add("org.springframework.boot.loader.JarLauncher"); defaultLauncherClasses.add("org.springframework.boot.loader.PropertiesLauncher"); defaultLauncherClasses.add("org.springframework.boot.loader.WarLauncher"); @@ -121,7 +121,7 @@ class BootArchiveSupport { } private void configureExclusions() { - Set excludes = new HashSet(); + Set excludes = new HashSet<>(); if (this.excludeDevtools) { excludes.add("**/spring-boot-devtools-*.jar"); } diff --git a/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootZipCopyAction.java b/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootZipCopyAction.java index 71dd5b8e1da..9ce874dfc3d 100644 --- a/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootZipCopyAction.java +++ b/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootZipCopyAction.java @@ -132,7 +132,7 @@ class BootZipCopyAction implements CopyAction { private Spec writeLoaderClasses(ZipArchiveOutputStream out) { try (ZipInputStream in = new ZipInputStream(getClass() .getResourceAsStream("/META-INF/loader/spring-boot-loader.jar"))) { - Set entries = new HashSet(); + Set entries = new HashSet<>(); java.util.zip.ZipEntry entry; while ((entry = in.getNextEntry()) != null) { if (entry.isDirectory() && !entry.getName().startsWith("META-INF/")) { diff --git a/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/LaunchScriptConfiguration.java b/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/LaunchScriptConfiguration.java index 40ee454fb5a..8aa4cae905e 100644 --- a/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/LaunchScriptConfiguration.java +++ b/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/LaunchScriptConfiguration.java @@ -34,7 +34,7 @@ public class LaunchScriptConfiguration implements Serializable { private boolean included = false; - private final Map properties = new HashMap(); + private final Map properties = new HashMap<>(); private File script; diff --git a/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/PomCondition.java b/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/PomCondition.java index b3d8f293a66..c991ebe04b2 100644 --- a/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/PomCondition.java +++ b/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/PomCondition.java @@ -40,7 +40,7 @@ class PomCondition extends Condition { private Set notExpectedContents; PomCondition() { - this(new HashSet(), new HashSet()); + this(new HashSet<>(), new HashSet<>()); } private PomCondition(Set expectedContents, Set notExpectedContents) { diff --git a/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/testkit/GradleBuild.java b/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/testkit/GradleBuild.java index 24328e45568..68922cd64f3 100644 --- a/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/testkit/GradleBuild.java +++ b/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/testkit/GradleBuild.java @@ -160,7 +160,7 @@ public class GradleBuild implements TestRule { if (this.gradleVersion != null) { gradleRunner.withGradleVersion(this.gradleVersion); } - List allArguments = new ArrayList(); + List allArguments = new ArrayList<>(); allArguments.add("-PpluginClasspath=" + pluginClasspath()); allArguments.add("-PbootVersion=" + getBootVersion()); allArguments.add("--stacktrace"); diff --git a/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/PropertiesLauncher.java b/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/PropertiesLauncher.java index b361c7ee526..a79d23256ee 100755 --- a/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/PropertiesLauncher.java +++ b/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/PropertiesLauncher.java @@ -330,7 +330,7 @@ public class PropertiesLauncher extends Launcher { @Override protected ClassLoader createClassLoader(List archives) throws Exception { - Set urls = new LinkedHashSet(archives.size()); + Set urls = new LinkedHashSet<>(archives.size()); for (Archive archive : archives) { urls.add(archive.getUrl()); } @@ -522,7 +522,7 @@ public class PropertiesLauncher extends Launcher { root = ""; } EntryFilter filter = new PrefixMatchingArchiveFilter(root); - List archives = new ArrayList(parent.getNestedArchives(filter)); + List archives = new ArrayList<>(parent.getNestedArchives(filter)); if (("".equals(root) || ".".equals(root)) && !path.endsWith(".jar") && parent != this.parent) { // You can't find the root with an entry filter so it has to be added diff --git a/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/util/SystemPropertyUtils.java b/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/util/SystemPropertyUtils.java index 2bbfa8bf0fe..42cc44ade2f 100644 --- a/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/util/SystemPropertyUtils.java +++ b/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/util/SystemPropertyUtils.java @@ -66,7 +66,7 @@ public abstract class SystemPropertyUtils { if (text == null) { return text; } - return parseStringValue(null, text, text, new HashSet()); + return parseStringValue(null, text, text, new HashSet<>()); } /** @@ -83,7 +83,7 @@ public abstract class SystemPropertyUtils { if (text == null) { return text; } - return parseStringValue(properties, text, text, new HashSet()); + return parseStringValue(properties, text, text, new HashSet<>()); } private static String parseStringValue(Properties properties, String value, diff --git a/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/PropertiesLauncherTests.java b/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/PropertiesLauncherTests.java index c62bd797bcb..b1a3059a536 100644 --- a/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/PropertiesLauncherTests.java +++ b/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/PropertiesLauncherTests.java @@ -266,7 +266,7 @@ public class PropertiesLauncherTests { } private List archives() throws Exception { - List archives = new ArrayList(); + List archives = new ArrayList<>(); String path = System.getProperty("java.class.path"); for (String url : path.split(File.pathSeparator)) { archives.add(archive(url)); diff --git a/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/runner/classpath/ModifiedClassPathRunner.java b/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/runner/classpath/ModifiedClassPathRunner.java index 6a619814690..d09fcd5411b 100644 --- a/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/runner/classpath/ModifiedClassPathRunner.java +++ b/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/runner/classpath/ModifiedClassPathRunner.java @@ -100,7 +100,7 @@ public class ModifiedClassPathRunner extends BlockJUnit4ClassRunner { } private URL[] extractUrls(URLClassLoader classLoader) throws Exception { - List extractedUrls = new ArrayList(); + List extractedUrls = new ArrayList<>(); for (URL url : classLoader.getURLs()) { if (isSurefireBooterJar(url)) { extractedUrls.addAll(extractUrlsFromManifestClassPath(url)); @@ -117,7 +117,7 @@ public class ModifiedClassPathRunner extends BlockJUnit4ClassRunner { } private List extractUrlsFromManifestClassPath(URL booterJar) throws Exception { - List urls = new ArrayList(); + List urls = new ArrayList<>(); for (String entry : getClassPath(booterJar)) { urls.add(new URL(entry)); } @@ -133,7 +133,7 @@ public class ModifiedClassPathRunner extends BlockJUnit4ClassRunner { private URL[] processUrls(URL[] urls, Class testClass) throws Exception { ClassPathEntryFilter filter = new ClassPathEntryFilter(testClass); - List processedUrls = new ArrayList(); + List processedUrls = new ArrayList<>(); processedUrls.addAll(getAdditionalUrls(testClass)); for (URL url : urls) { if (!filter.isExcluded(url)) { @@ -173,7 +173,7 @@ public class ModifiedClassPathRunner extends BlockJUnit4ClassRunner { DependencyRequest dependencyRequest = new DependencyRequest(collectRequest, null); DependencyResult result = repositorySystem.resolveDependencies(session, dependencyRequest); - List resolvedArtifacts = new ArrayList(); + List resolvedArtifacts = new ArrayList<>(); for (ArtifactResult artifact : result.getArtifactResults()) { resolvedArtifacts.add(artifact.getArtifact().getFile().toURI().toURL()); } @@ -181,7 +181,7 @@ public class ModifiedClassPathRunner extends BlockJUnit4ClassRunner { } private List createDependencies(String[] allCoordinates) { - List dependencies = new ArrayList(); + List dependencies = new ArrayList<>(); for (String coordinate : allCoordinates) { dependencies.add(new Dependency(new DefaultArtifact(coordinate), null)); } @@ -254,8 +254,7 @@ public class ModifiedClassPathRunner extends BlockJUnit4ClassRunner { private List wrapFrameworkMethods( List methods) { - List wrapped = new ArrayList( - methods.size()); + List wrapped = new ArrayList<>(methods.size()); for (FrameworkMethod frameworkMethod : methods) { wrapped.add(new ModifiedClassPathFrameworkMethod( frameworkMethod.getMethod())); diff --git a/spring-boot/src/main/java/org/springframework/boot/EnvironmentConverter.java b/spring-boot/src/main/java/org/springframework/boot/EnvironmentConverter.java index d99ca1cf1d8..8087f70fe8f 100644 --- a/spring-boot/src/main/java/org/springframework/boot/EnvironmentConverter.java +++ b/spring-boot/src/main/java/org/springframework/boot/EnvironmentConverter.java @@ -42,7 +42,7 @@ final class EnvironmentConverter { private static final Set SERVLET_ENVIRONMENT_SOURCE_NAMES; static { - final Set names = new HashSet(); + final Set names = new HashSet<>(); names.add(StandardServletEnvironment.SERVLET_CONTEXT_PROPERTY_SOURCE_NAME); names.add(StandardServletEnvironment.SERVLET_CONFIG_PROPERTY_SOURCE_NAME); names.add(StandardServletEnvironment.JNDI_PROPERTY_SOURCE_NAME); @@ -109,7 +109,7 @@ final class EnvironmentConverter { } private void removeAllPropertySources(MutablePropertySources propertySources) { - Set names = new HashSet(); + Set names = new HashSet<>(); for (PropertySource propertySource : propertySources) { names.add(propertySource.getName()); } diff --git a/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertyName.java b/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertyName.java index 8516461a70d..f621665692e 100644 --- a/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertyName.java +++ b/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertyName.java @@ -451,7 +451,7 @@ public final class ConfigurationPropertyName if (name.length() == 0) { return EMPTY; } - List elements = new ArrayList(10); + List elements = new ArrayList<>(10); process(name, '.', (elementValue, start, end, indexed) -> { if (elementValue.length() > 0) { if (!indexed) { @@ -496,7 +496,7 @@ public final class ConfigurationPropertyName if (name.length() == 0) { return EMPTY; } - List elements = new ArrayList(10); + List elements = new ArrayList<>(10); process(name, separator, (elementValue, start, end, indexed) -> { elementValue = elementValueProcessor.apply(elementValue); if (!isIndexed(elementValue)) { diff --git a/spring-boot/src/main/java/org/springframework/boot/env/OriginTrackedYamlLoader.java b/spring-boot/src/main/java/org/springframework/boot/env/OriginTrackedYamlLoader.java index 5e8a3996f3e..a11aa76ad20 100644 --- a/spring-boot/src/main/java/org/springframework/boot/env/OriginTrackedYamlLoader.java +++ b/spring-boot/src/main/java/org/springframework/boot/env/OriginTrackedYamlLoader.java @@ -78,7 +78,7 @@ class OriginTrackedYamlLoader extends YamlProcessor { } public Map load() { - final Map result = new LinkedHashMap(); + final Map result = new LinkedHashMap<>(); process((properties, map) -> { result.putAll(getFlattenedMap(map)); }); diff --git a/spring-boot/src/main/java/org/springframework/boot/jta/narayana/NarayanaProperties.java b/spring-boot/src/main/java/org/springframework/boot/jta/narayana/NarayanaProperties.java index e09c5278215..96a8cd5cee3 100644 --- a/spring-boot/src/main/java/org/springframework/boot/jta/narayana/NarayanaProperties.java +++ b/spring-boot/src/main/java/org/springframework/boot/jta/narayana/NarayanaProperties.java @@ -91,21 +91,21 @@ public class NarayanaProperties { /** * Comma-separated list of orphan filters. */ - private List xaResourceOrphanFilters = new ArrayList(Arrays.asList( + private List xaResourceOrphanFilters = new ArrayList<>(Arrays.asList( "com.arjuna.ats.internal.jta.recovery.arjunacore.JTATransactionLogXAResourceOrphanFilter", "com.arjuna.ats.internal.jta.recovery.arjunacore.JTANodeNameXAResourceOrphanFilter")); /** * Comma-separated list of recovery modules. */ - private List recoveryModules = new ArrayList(Arrays.asList( + private List recoveryModules = new ArrayList<>(Arrays.asList( "com.arjuna.ats.internal.arjuna.recovery.AtomicActionRecoveryModule", "com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule")); /** * Comma-separated list of expiry scanners. */ - private List expiryScanners = new ArrayList(Collections.singletonList( + private List expiryScanners = new ArrayList<>(Collections.singletonList( "com.arjuna.ats.internal.arjuna.recovery.ExpiredTransactionStatusManagerScanner")); public String getLogDir() { diff --git a/spring-boot/src/main/java/org/springframework/boot/web/context/ServerPortInfoApplicationContextInitializer.java b/spring-boot/src/main/java/org/springframework/boot/web/context/ServerPortInfoApplicationContextInitializer.java index ee13f5bddf3..5d2555eb42b 100644 --- a/spring-boot/src/main/java/org/springframework/boot/web/context/ServerPortInfoApplicationContextInitializer.java +++ b/spring-boot/src/main/java/org/springframework/boot/web/context/ServerPortInfoApplicationContextInitializer.java @@ -88,7 +88,7 @@ public class ServerPortInfoApplicationContextInitializer MutablePropertySources sources = environment.getPropertySources(); PropertySource source = sources.get("server.ports"); if (source == null) { - source = new MapPropertySource("server.ports", new HashMap()); + source = new MapPropertySource("server.ports", new HashMap<>()); sources.addFirst(source); } ((Map) source.getSource()).put(propertyName, port); diff --git a/spring-boot/src/main/java/org/springframework/boot/web/embedded/undertow/UndertowServletWebServerFactory.java b/spring-boot/src/main/java/org/springframework/boot/web/embedded/undertow/UndertowServletWebServerFactory.java index f223912c914..9674e3ab7f1 100644 --- a/spring-boot/src/main/java/org/springframework/boot/web/embedded/undertow/UndertowServletWebServerFactory.java +++ b/spring-boot/src/main/java/org/springframework/boot/web/embedded/undertow/UndertowServletWebServerFactory.java @@ -489,7 +489,7 @@ public class UndertowServletWebServerFactory extends AbstractServletWebServerFac File root = getValidDocumentRoot(); File docBase = getCanonicalDocumentRoot(root); List metaInfResourceUrls = getUrlsOfJarsWithMetaInfResources(); - List resourceJarUrls = new ArrayList(); + List resourceJarUrls = new ArrayList<>(); List resourceManagers = new ArrayList(); ResourceManager rootResourceManager = docBase.isDirectory() ? new FileResourceManager(docBase, 0) : new JarResourceManager(docBase); diff --git a/spring-boot/src/test/java/org/springframework/boot/context/properties/ConfigurationPropertiesBindingPostProcessorTests.java b/spring-boot/src/test/java/org/springframework/boot/context/properties/ConfigurationPropertiesBindingPostProcessorTests.java index 6b3e1dab6cc..a60e9019206 100644 --- a/spring-boot/src/test/java/org/springframework/boot/context/properties/ConfigurationPropertiesBindingPostProcessorTests.java +++ b/spring-boot/src/test/java/org/springframework/boot/context/properties/ConfigurationPropertiesBindingPostProcessorTests.java @@ -444,7 +444,7 @@ public class ConfigurationPropertiesBindingPostProcessorTests { this.context = new AnnotationConfigApplicationContext(); MutablePropertySources sources = this.context.getEnvironment() .getPropertySources(); - Map source = new LinkedHashMap(); + Map source = new LinkedHashMap<>(); source.put("example.one", "foo"); sources.addFirst(new MapPropertySource("test-source", source)); this.context.register(PrototypePropertiesConfig.class); diff --git a/spring-boot/src/test/java/org/springframework/boot/web/server/WebServerFactoryCustomizerBeanPostProcessorTests.java b/spring-boot/src/test/java/org/springframework/boot/web/server/WebServerFactoryCustomizerBeanPostProcessorTests.java index f1abc115bba..94a3908015a 100644 --- a/spring-boot/src/test/java/org/springframework/boot/web/server/WebServerFactoryCustomizerBeanPostProcessorTests.java +++ b/spring-boot/src/test/java/org/springframework/boot/web/server/WebServerFactoryCustomizerBeanPostProcessorTests.java @@ -154,7 +154,7 @@ public class WebServerFactoryCustomizerBeanPostProcessorTests { WebServerFactoryCustomizer one = (f) -> called.add("one"); WebServerFactoryCustomizer two = (f) -> called.add("two"); WebServerFactoryCustomizer all = (f) -> called.add("all"); - Map beans = new LinkedHashMap(); + Map beans = new LinkedHashMap<>(); beans.put("one", one); beans.put("two", two); beans.put("all", all);