From 6168fae720ae836beda9379e8c36dd5e50629a3d Mon Sep 17 00:00:00 2001 From: Johnny Lim Date: Tue, 3 Oct 2017 01:25:51 +0900 Subject: [PATCH] Remove explicit type arguments See gh-10494 --- .../ManagementServerFactoryCustomizer.java | 2 +- .../servlet/RequestMappingEndpointTests.java | 5 ++--- .../actuate/context/ShutdownEndpoint.java | 4 ++-- ...ConfigurationPropertiesReportEndpoint.java | 2 +- ...uditEventsEndpointWebIntegrationTests.java | 2 +- .../audit/listener/AuditListenerTests.java | 2 +- .../AuthorizationAuditListenerTests.java | 7 +++---- .../trace/InMemoryTraceRepositoryTests.java | 12 +++++------ .../actuate/trace/TraceEndpointTests.java | 2 +- .../AutoConfigurationPackages.java | 2 +- .../AutoConfigurationSorter.java | 4 ++-- ...ImportAutoConfigurationImportSelector.java | 2 +- .../cache/CacheManagerCustomizers.java | 2 +- .../autoconfigure/domain/EntityScanner.java | 2 +- .../http/HttpMessageConverters.java | 2 +- ...ttpMessageConvertersAutoConfiguration.java | 2 +- .../ActiveMQConnectionFactoryFactory.java | 2 +- .../ldap/LdapAutoConfiguration.java | 2 +- .../EmbeddedMongoAutoConfiguration.java | 2 +- .../servlet/error/BasicErrorController.java | 2 +- .../AutoConfigurationImportSelectorTests.java | 2 +- .../cache/CacheAutoConfigurationTests.java | 2 +- ...ionAutoConfigurationImportFilterTests.java | 4 ++-- .../domain/EntityScanPackagesTests.java | 2 +- ...stJpaDependencyAutoConfigurationTests.java | 2 +- .../jms/activemq/ActiveMQPropertiesTests.java | 2 +- .../jndi/JndiPropertiesHidingClassLoader.java | 2 +- ...ingViewResolverAutoConfigurationTests.java | 8 ++++---- .../boot/cli/DefaultCommandFactory.java | 2 +- .../cli/compiler/dependencies/Dependency.java | 2 +- .../boot/groovy/GroovyTemplate.java | 2 +- .../cli/command/CustomCommandFactory.java | 2 +- .../init/ProjectGenerationRequestTests.java | 2 +- .../boot/devtools/restart/ChangeableUrls.java | 4 ++-- .../LocalDevToolsAutoConfigurationTests.java | 11 +++++----- .../DevToolPropertiesIntegrationTests.java | 2 +- .../remote/server/DispatcherTests.java | 2 +- .../context/ImportsContextCustomizer.java | 4 ++-- .../test/mock/mockito/DefinitionsParser.java | 2 +- .../ImportsContextCustomizerTests.java | 2 +- .../JsonReaderTests.java | 2 +- .../metadata/ItemHint.java | 2 +- ...ationMetadataAnnotationProcessorTests.java | 4 ++-- .../metadata/JsonMarshallerTests.java | 2 +- .../boot/maven/DependencyFilterMojoTests.java | 10 +++++----- .../web/servlet/MockServletWebServer.java | 2 +- .../springframework/boot/ResourceBanner.java | 2 +- ...mpositeDataSourcePoolMetadataProvider.java | 2 +- ...ikosDependsOnBeanFactoryPostProcessor.java | 2 +- .../boot/web/client/RestTemplateBuilder.java | 8 ++++---- .../boot/ResourceBannerTests.java | 2 +- .../boot/SpringApplicationTests.java | 2 +- .../SpringApplicationBuilderTests.java | 2 +- .../ConfigFileApplicationListenerTests.java | 2 +- ...onPropertiesBindingPostProcessorTests.java | 2 +- .../EnableConfigurationPropertiesTests.java | 2 +- .../ConfigurationPropertySourcesTests.java | 14 ++++++------- ...ringConfigurationPropertySourcesTests.java | 20 +++++++++---------- .../web/client/RestTemplateBuilderTests.java | 4 ++-- .../SpringBootServletInitializerTests.java | 2 +- .../SampleAtmosphereApplication.java | 2 +- 61 files changed, 105 insertions(+), 108 deletions(-) diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/ManagementServerFactoryCustomizer.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/ManagementServerFactoryCustomizer.java index 030b7dbc09..c1a626a118 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/ManagementServerFactoryCustomizer.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/ManagementServerFactoryCustomizer.java @@ -67,7 +67,7 @@ public abstract class ManagementServerFactoryCustomizeremptySet()); + factory.setErrorPages(Collections.emptySet()); // and add the management-specific bits customize(factory, managementServerProperties, serverProperties); } diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/servlet/RequestMappingEndpointTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/servlet/RequestMappingEndpointTests.java index 2ce195dce3..2f9ad3c27f 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/servlet/RequestMappingEndpointTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/servlet/RequestMappingEndpointTests.java @@ -38,7 +38,6 @@ import org.springframework.context.annotation.Lazy; import org.springframework.context.annotation.Scope; import org.springframework.context.annotation.ScopedProxyMode; import org.springframework.context.support.StaticApplicationContext; -import org.springframework.web.servlet.handler.AbstractHandlerMethodMapping; import org.springframework.web.servlet.handler.AbstractUrlHandlerMapping; import org.springframework.web.servlet.handler.SimpleUrlHandlerMapping; @@ -60,7 +59,7 @@ public class RequestMappingEndpointTests { mapping.setApplicationContext(new StaticApplicationContext()); mapping.initApplicationContext(); this.endpoint.setHandlerMappings( - Collections.singletonList(mapping)); + Collections.singletonList(mapping)); Map result = this.endpoint.mappings(); assertThat(result).hasSize(1); @SuppressWarnings("unchecked") @@ -121,7 +120,7 @@ public class RequestMappingEndpointTests { public void concreteMethodMappings() { WebMvcEndpointHandlerMapping mapping = createHandlerMapping(); this.endpoint.setMethodMappings( - Collections.>singletonList(mapping)); + Collections.singletonList(mapping)); Map result = this.endpoint.mappings(); assertThat(result).hasSize(2); assertThat(result.keySet()) diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/context/ShutdownEndpoint.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/context/ShutdownEndpoint.java index 53e5a1964f..06cb33b080 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/context/ShutdownEndpoint.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/context/ShutdownEndpoint.java @@ -39,11 +39,11 @@ import org.springframework.context.ConfigurableApplicationContext; public class ShutdownEndpoint implements ApplicationContextAware { private static final Map NO_CONTEXT_MESSAGE = Collections - .unmodifiableMap(Collections.singletonMap("message", + .unmodifiableMap(Collections.singletonMap("message", "No context to shutdown.")); private static final Map SHUTDOWN_MESSAGE = Collections - .unmodifiableMap(Collections.singletonMap("message", + .unmodifiableMap(Collections.singletonMap("message", "Shutting down, bye...")); private ConfigurableApplicationContext context; diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/context/properties/ConfigurationPropertiesReportEndpoint.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/context/properties/ConfigurationPropertiesReportEndpoint.java index fdaf881c51..91776956a2 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/context/properties/ConfigurationPropertiesReportEndpoint.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/context/properties/ConfigurationPropertiesReportEndpoint.java @@ -154,7 +154,7 @@ public class ConfigurationPropertiesReportEndpoint implements ApplicationContext return result; } catch (Exception ex) { - return new HashMap<>(Collections.singletonMap("error", + return new HashMap<>(Collections.singletonMap("error", "Cannot serialize '" + prefix + "'")); } } diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/audit/AuditEventsEndpointWebIntegrationTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/audit/AuditEventsEndpointWebIntegrationTests.java index 6383ccadcb..dd292d24a1 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/audit/AuditEventsEndpointWebIntegrationTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/audit/AuditEventsEndpointWebIntegrationTests.java @@ -106,7 +106,7 @@ public class AuditEventsEndpointWebIntegrationTests { private AuditEvent createEvent(String instant, String principal, String type) { return new AuditEvent(Date.from(Instant.parse(instant)), principal, type, - Collections.emptyMap()); + Collections.emptyMap()); } } diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/audit/listener/AuditListenerTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/audit/listener/AuditListenerTests.java index cf547aaacb..2613b3ea76 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/audit/listener/AuditListenerTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/audit/listener/AuditListenerTests.java @@ -37,7 +37,7 @@ public class AuditListenerTests { public void testStoredEvents() { AuditEventRepository repository = mock(AuditEventRepository.class); AuditEvent event = new AuditEvent("principal", "type", - Collections.emptyMap()); + Collections.emptyMap()); AuditListener listener = new AuditListener(repository); listener.onApplicationEvent(new AuditApplicationEvent(event)); verify(repository).add(event); diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/security/AuthorizationAuditListenerTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/security/AuthorizationAuditListenerTests.java index 4b1cc89eeb..16319be6ed 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/security/AuthorizationAuditListenerTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/security/AuthorizationAuditListenerTests.java @@ -25,7 +25,6 @@ import org.mockito.ArgumentCaptor; import org.springframework.boot.actuate.audit.listener.AuditApplicationEvent; import org.springframework.context.ApplicationEventPublisher; import org.springframework.security.access.AccessDeniedException; -import org.springframework.security.access.ConfigAttribute; import org.springframework.security.access.SecurityConfig; import org.springframework.security.access.event.AbstractAuthorizationEvent; import org.springframework.security.access.event.AuthenticationCredentialsNotFoundEvent; @@ -56,7 +55,7 @@ public class AuthorizationAuditListenerTests { public void testAuthenticationCredentialsNotFound() { AuditApplicationEvent event = handleAuthorizationEvent( new AuthenticationCredentialsNotFoundEvent(this, - Collections.singletonList( + Collections.singletonList( new SecurityConfig("USER")), new AuthenticationCredentialsNotFoundException("Bad user"))); assertThat(event.getAuditEvent().getType()) @@ -67,7 +66,7 @@ public class AuthorizationAuditListenerTests { public void testAuthorizationFailure() { AuditApplicationEvent event = handleAuthorizationEvent( new AuthorizationFailureEvent(this, - Collections.singletonList( + Collections.singletonList( new SecurityConfig("USER")), new UsernamePasswordAuthenticationToken("user", "password"), new AccessDeniedException("Bad user"))); @@ -83,7 +82,7 @@ public class AuthorizationAuditListenerTests { authentication.setDetails(details); AuditApplicationEvent event = handleAuthorizationEvent( new AuthorizationFailureEvent(this, - Collections.singletonList( + Collections.singletonList( new SecurityConfig("USER")), authentication, new AccessDeniedException("Bad user"))); assertThat(event.getAuditEvent().getType()) diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/trace/InMemoryTraceRepositoryTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/trace/InMemoryTraceRepositoryTests.java index 0c55adc7d8..6980fde5b7 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/trace/InMemoryTraceRepositoryTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/trace/InMemoryTraceRepositoryTests.java @@ -35,9 +35,9 @@ public class InMemoryTraceRepositoryTests { @Test public void capacityLimited() { this.repository.setCapacity(2); - this.repository.add(Collections.singletonMap("foo", "bar")); - this.repository.add(Collections.singletonMap("bar", "foo")); - this.repository.add(Collections.singletonMap("bar", "bar")); + this.repository.add(Collections.singletonMap("foo", "bar")); + this.repository.add(Collections.singletonMap("bar", "foo")); + this.repository.add(Collections.singletonMap("bar", "bar")); List traces = this.repository.findAll(); assertThat(traces).hasSize(2); assertThat(traces.get(0).getInfo().get("bar")).isEqualTo("bar"); @@ -48,9 +48,9 @@ public class InMemoryTraceRepositoryTests { public void reverseFalse() { this.repository.setReverse(false); this.repository.setCapacity(2); - this.repository.add(Collections.singletonMap("foo", "bar")); - this.repository.add(Collections.singletonMap("bar", "foo")); - this.repository.add(Collections.singletonMap("bar", "bar")); + this.repository.add(Collections.singletonMap("foo", "bar")); + this.repository.add(Collections.singletonMap("bar", "foo")); + this.repository.add(Collections.singletonMap("bar", "bar")); List traces = this.repository.findAll(); assertThat(traces).hasSize(2); assertThat(traces.get(1).getInfo().get("bar")).isEqualTo("bar"); diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/trace/TraceEndpointTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/trace/TraceEndpointTests.java index 5d3af1538b..938c96bcce 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/trace/TraceEndpointTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/trace/TraceEndpointTests.java @@ -33,7 +33,7 @@ public class TraceEndpointTests { @Test public void trace() throws Exception { TraceRepository repository = new InMemoryTraceRepository(); - repository.add(Collections.singletonMap("a", "b")); + repository.add(Collections.singletonMap("a", "b")); Trace trace = new TraceEndpoint(repository).traces().getTraces().get(0); assertThat(trace.getInfo().get("a")).isEqualTo("b"); } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigurationPackages.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigurationPackages.java index ed769ee4ed..963af72651 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigurationPackages.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigurationPackages.java @@ -131,7 +131,7 @@ public abstract class AutoConfigurationPackages { @Override public Set determineImports(AnnotationMetadata metadata) { - return Collections.singleton(new PackageImport(metadata)); + return Collections.singleton(new PackageImport(metadata)); } } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigurationSorter.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigurationSorter.java index b6c5570cda..f5afa6d91c 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigurationSorter.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigurationSorter.java @@ -174,7 +174,7 @@ class AutoConfigurationSorter { private Set readBefore() { if (wasProcessed()) { return this.autoConfigurationMetadata.getSet(this.className, - "AutoConfigureBefore", Collections.emptySet()); + "AutoConfigureBefore", Collections.emptySet()); } return getAnnotationValue(AutoConfigureBefore.class); } @@ -182,7 +182,7 @@ class AutoConfigurationSorter { private Set readAfter() { if (wasProcessed()) { return this.autoConfigurationMetadata.getSet(this.className, - "AutoConfigureAfter", Collections.emptySet()); + "AutoConfigureAfter", Collections.emptySet()); } return getAnnotationValue(AutoConfigureAfter.class); } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/ImportAutoConfigurationImportSelector.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/ImportAutoConfigurationImportSelector.java index c3d3ce0675..5857da091a 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/ImportAutoConfigurationImportSelector.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/ImportAutoConfigurationImportSelector.java @@ -61,7 +61,7 @@ class ImportAutoConfigurationImportSelector extends AutoConfigurationImportSelec Set result = new LinkedHashSet<>(); result.addAll(getCandidateConfigurations(metadata, null)); result.removeAll(getExclusions(metadata, null)); - return Collections.unmodifiableSet(result); + return Collections.unmodifiableSet(result); } @Override diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/CacheManagerCustomizers.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/CacheManagerCustomizers.java index a9b57add7b..489aebd600 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/CacheManagerCustomizers.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/CacheManagerCustomizers.java @@ -42,7 +42,7 @@ public class CacheManagerCustomizers { public CacheManagerCustomizers( List> customizers) { this.customizers = (customizers != null ? new ArrayList<>(customizers) - : Collections.>emptyList()); + : Collections.emptyList()); } /** diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/domain/EntityScanner.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/domain/EntityScanner.java index e23afb80b8..502d5d9f57 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/domain/EntityScanner.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/domain/EntityScanner.java @@ -62,7 +62,7 @@ public class EntityScanner { throws ClassNotFoundException { List packages = getPackages(); if (packages.isEmpty()) { - return Collections.>emptySet(); + return Collections.emptySet(); } Set> entitySet = new HashSet<>(); ClassPathScanningCandidateComponentProvider scanner = new ClassPathScanningCandidateComponentProvider( diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/http/HttpMessageConverters.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/http/HttpMessageConverters.java index 44cef8b713..1f9150a15f 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/http/HttpMessageConverters.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/http/HttpMessageConverters.java @@ -104,7 +104,7 @@ public class HttpMessageConverters implements Iterable> Collection> converters) { List> combined = getCombinedConverters(converters, addDefaultConverters ? getDefaultConverters() - : Collections.>emptyList()); + : Collections.emptyList()); combined = postProcessConverters(combined); this.converters = Collections.unmodifiableList(combined); } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/http/HttpMessageConvertersAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/http/HttpMessageConvertersAutoConfiguration.java index 7cb9ae218f..50c1c5c2a0 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/http/HttpMessageConvertersAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/http/HttpMessageConvertersAutoConfiguration.java @@ -69,7 +69,7 @@ public class HttpMessageConvertersAutoConfiguration { @ConditionalOnMissingBean public HttpMessageConverters messageConverters() { return new HttpMessageConverters(this.converters == null - ? Collections.>emptyList() : this.converters); + ? Collections.emptyList() : this.converters); } @Configuration diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQConnectionFactoryFactory.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQConnectionFactoryFactory.java index e5edb78f74..1b44cf71ac 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQConnectionFactoryFactory.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQConnectionFactoryFactory.java @@ -49,7 +49,7 @@ class ActiveMQConnectionFactoryFactory { Assert.notNull(properties, "Properties must not be null"); this.properties = properties; this.factoryCustomizers = (factoryCustomizers != null ? factoryCustomizers - : Collections.emptyList()); + : Collections.emptyList()); } public T createConnectionFactory( diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/ldap/LdapAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/ldap/LdapAutoConfiguration.java index d8f3acd6e8..672689dd8c 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/ldap/LdapAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/ldap/LdapAutoConfiguration.java @@ -57,7 +57,7 @@ public class LdapAutoConfiguration { source.setBase(this.properties.getBase()); source.setUrls(this.properties.determineUrls(this.environment)); source.setBaseEnvironmentProperties(Collections - .unmodifiableMap(this.properties.getBaseEnvironment())); + .unmodifiableMap(this.properties.getBaseEnvironment())); return source; } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mongo/embedded/EmbeddedMongoAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mongo/embedded/EmbeddedMongoAutoConfiguration.java index 725be1bd52..45f3903681 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mongo/embedded/EmbeddedMongoAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mongo/embedded/EmbeddedMongoAutoConfiguration.java @@ -258,7 +258,7 @@ public class EmbeddedMongoAutoConfiguration { Set features) { Assert.notNull(version, "version must not be null"); this.version = version; - this.features = (features == null ? Collections.emptySet() + this.features = (features == null ? Collections.emptySet() : features); } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/error/BasicErrorController.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/error/BasicErrorController.java index ba3616421e..41e5eb131c 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/error/BasicErrorController.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/error/BasicErrorController.java @@ -63,7 +63,7 @@ public class BasicErrorController extends AbstractErrorController { public BasicErrorController(ErrorAttributes errorAttributes, ErrorProperties errorProperties) { this(errorAttributes, errorProperties, - Collections.emptyList()); + Collections.emptyList()); } /** diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/AutoConfigurationImportSelectorTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/AutoConfigurationImportSelectorTests.java index 5c2f94603a..f2c8875fc0 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/AutoConfigurationImportSelectorTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/AutoConfigurationImportSelectorTests.java @@ -248,7 +248,7 @@ public class AutoConfigurationImportSelectorTests { @Override protected List getAutoConfigurationImportListeners() { - return Collections.singletonList( + return Collections.singletonList( (event) -> this.lastEvent = event); } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfigurationTests.java index e80c26a434..7c765abbf6 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfigurationTests.java @@ -936,7 +936,7 @@ public class CacheAutoConfigurationTests { public javax.cache.CacheManager customJCacheCacheManager() { javax.cache.CacheManager cacheManager = mock(javax.cache.CacheManager.class); given(cacheManager.getCacheNames()) - .willReturn(Collections.emptyList()); + .willReturn(Collections.emptyList()); return cacheManager; } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/OnClassConditionAutoConfigurationImportFilterTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/OnClassConditionAutoConfigurationImportFilterTests.java index a8f34dd52e..1d53c5267b 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/OnClassConditionAutoConfigurationImportFilterTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/OnClassConditionAutoConfigurationImportFilterTests.java @@ -76,10 +76,10 @@ public class OnClassConditionAutoConfigurationImportFilterTests { AutoConfigurationMetadata metadata = mock(AutoConfigurationMetadata.class); given(metadata.wasProcessed("test.match")).willReturn(true); given(metadata.getSet("test.match", "ConditionalOnClass")) - .willReturn(Collections.singleton("java.io.InputStream")); + .willReturn(Collections.singleton("java.io.InputStream")); given(metadata.wasProcessed("test.nomatch")).willReturn(true); given(metadata.getSet("test.nomatch", "ConditionalOnClass")) - .willReturn(Collections.singleton("java.io.DoesNotExist")); + .willReturn(Collections.singleton("java.io.DoesNotExist")); return metadata; } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/domain/EntityScanPackagesTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/domain/EntityScanPackagesTests.java index b455c96fab..f204449e63 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/domain/EntityScanPackagesTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/domain/EntityScanPackagesTests.java @@ -92,7 +92,7 @@ public class EntityScanPackagesTests { throws Exception { this.thrown.expect(IllegalArgumentException.class); this.thrown.expectMessage("Registry must not be null"); - EntityScanPackages.register(null, Collections.emptyList()); + EntityScanPackages.register(null, Collections.emptyList()); } @Test diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastJpaDependencyAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastJpaDependencyAutoConfigurationTests.java index 79a01606c3..3ece48df6a 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastJpaDependencyAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastJpaDependencyAutoConfigurationTests.java @@ -103,7 +103,7 @@ public class HazelcastJpaDependencyAutoConfigurationTests { .getSourceApplicationContext()).getBeanDefinition("entityManagerFactory") .getDependsOn(); return dependsOn != null ? Arrays.asList(dependsOn) - : Collections.emptyList(); + : Collections.emptyList(); } @Configuration diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQPropertiesTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQPropertiesTests.java index fb3bb861cc..e18e3ec0a7 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQPropertiesTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQPropertiesTests.java @@ -88,7 +88,7 @@ public class ActiveMQPropertiesTests { private ActiveMQConnectionFactoryFactory createFactory( ActiveMQProperties properties) { return new ActiveMQConnectionFactoryFactory(properties, - Collections.emptyList()); + Collections.emptyList()); } } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jndi/JndiPropertiesHidingClassLoader.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jndi/JndiPropertiesHidingClassLoader.java index f56564473e..659fc33dd4 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jndi/JndiPropertiesHidingClassLoader.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jndi/JndiPropertiesHidingClassLoader.java @@ -36,7 +36,7 @@ public class JndiPropertiesHidingClassLoader extends ClassLoader { @Override public Enumeration getResources(String name) throws IOException { if ("jndi.properties".equals(name)) { - return Collections.enumeration(Collections.emptyList()); + return Collections.enumeration(Collections.emptyList()); } return super.getResources(name); } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mobile/DeviceDelegatingViewResolverAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mobile/DeviceDelegatingViewResolverAutoConfigurationTests.java index 64686e8151..729c95b864 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mobile/DeviceDelegatingViewResolverAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mobile/DeviceDelegatingViewResolverAutoConfigurationTests.java @@ -89,7 +89,7 @@ public class DeviceDelegatingViewResolverAutoConfigurationTests { @Test public void deviceDelegatingFreeMarkerViewResolver() throws Exception { - load(Collections.>singletonList(FreeMarkerAutoConfiguration.class), + load(Collections.singletonList(FreeMarkerAutoConfiguration.class), "spring.mobile.devicedelegatingviewresolver.enabled:true"); assertThat(this.context.getBeansOfType(LiteDeviceDelegatingViewResolver.class)) .hasSize(2); @@ -100,7 +100,7 @@ public class DeviceDelegatingViewResolverAutoConfigurationTests { @Test public void deviceDelegatingGroovyMarkupViewResolver() throws Exception { - load(Collections.>singletonList(GroovyTemplateAutoConfiguration.class), + load(Collections.singletonList(GroovyTemplateAutoConfiguration.class), "spring.mobile.devicedelegatingviewresolver.enabled:true"); assertThat(this.context.getBeansOfType(LiteDeviceDelegatingViewResolver.class)) .hasSize(2); @@ -111,7 +111,7 @@ public class DeviceDelegatingViewResolverAutoConfigurationTests { @Test public void deviceDelegatingMustacheViewResolver() throws Exception { - load(Collections.>singletonList(MustacheAutoConfiguration.class), + load(Collections.singletonList(MustacheAutoConfiguration.class), "spring.mobile.devicedelegatingviewresolver.enabled:true"); assertThat(this.context.getBeansOfType(LiteDeviceDelegatingViewResolver.class)) .hasSize(2); @@ -122,7 +122,7 @@ public class DeviceDelegatingViewResolverAutoConfigurationTests { @Test public void deviceDelegatingThymeleafViewResolver() throws Exception { - load(Collections.>singletonList(ThymeleafAutoConfiguration.class), + load(Collections.singletonList(ThymeleafAutoConfiguration.class), "spring.mobile.devicedelegatingviewresolver.enabled:true"); assertThat(this.context.getBeansOfType(LiteDeviceDelegatingViewResolver.class)) .hasSize(2); diff --git a/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/DefaultCommandFactory.java b/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/DefaultCommandFactory.java index 80ef7dff6a..bf01b5a54e 100644 --- a/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/DefaultCommandFactory.java +++ b/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/DefaultCommandFactory.java @@ -38,7 +38,7 @@ import org.springframework.boot.cli.command.run.RunCommand; */ public class DefaultCommandFactory implements CommandFactory { - private static final List defaultCommands = Arrays.asList( + private static final List defaultCommands = Arrays.asList( new VersionCommand(), new RunCommand(), new GrabCommand(), new JarCommand(), new WarCommand(), new InstallCommand(), new UninstallCommand(), new InitCommand()); diff --git a/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/dependencies/Dependency.java b/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/dependencies/Dependency.java index 70aa289daa..34c8f16fb7 100644 --- a/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/dependencies/Dependency.java +++ b/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/dependencies/Dependency.java @@ -44,7 +44,7 @@ public final class Dependency { * @param version the version */ public Dependency(String groupId, String artifactId, String version) { - this(groupId, artifactId, version, Collections.emptyList()); + this(groupId, artifactId, version, Collections.emptyList()); } /** diff --git a/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/groovy/GroovyTemplate.java b/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/groovy/GroovyTemplate.java index a0986fdcac..d3e9ff25a0 100644 --- a/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/groovy/GroovyTemplate.java +++ b/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/groovy/GroovyTemplate.java @@ -38,7 +38,7 @@ public abstract class GroovyTemplate { public static String template(String name) throws IOException, CompilationFailedException, ClassNotFoundException { - return template(name, Collections.emptyMap()); + return template(name, Collections.emptyMap()); } public static String template(String name, Map model) diff --git a/spring-boot-project/spring-boot-cli/src/test/java/cli/command/CustomCommandFactory.java b/spring-boot-project/spring-boot-cli/src/test/java/cli/command/CustomCommandFactory.java index a1d9aab462..f2365ac032 100644 --- a/spring-boot-project/spring-boot-cli/src/test/java/cli/command/CustomCommandFactory.java +++ b/spring-boot-project/spring-boot-cli/src/test/java/cli/command/CustomCommandFactory.java @@ -29,7 +29,7 @@ public class CustomCommandFactory implements CommandFactory { @Override public Collection getCommands() { - return Collections.singleton(new CustomCommand()); + return Collections.singleton(new CustomCommand()); } } diff --git a/spring-boot-project/spring-boot-cli/src/test/java/org/springframework/boot/cli/command/init/ProjectGenerationRequestTests.java b/spring-boot-project/spring-boot-cli/src/test/java/org/springframework/boot/cli/command/init/ProjectGenerationRequestTests.java index 1dec8c59ea..470a14ed8d 100644 --- a/spring-boot-project/spring-boot-cli/src/test/java/org/springframework/boot/cli/command/init/ProjectGenerationRequestTests.java +++ b/spring-boot-project/spring-boot-cli/src/test/java/org/springframework/boot/cli/command/init/ProjectGenerationRequestTests.java @@ -44,7 +44,7 @@ import static org.assertj.core.api.Assertions.assertThat; public class ProjectGenerationRequestTests { public static final Map EMPTY_TAGS = Collections - .emptyMap(); + .emptyMap(); @Rule public final ExpectedException thrown = ExpectedException.none(); diff --git a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/ChangeableUrls.java b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/ChangeableUrls.java index 2a10f38b3c..f098982d45 100644 --- a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/ChangeableUrls.java +++ b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/ChangeableUrls.java @@ -123,7 +123,7 @@ final class ChangeableUrls implements Iterable { private static List getUrlsFromClassPathOfJarManifestIfPossible(URL url) { JarFile jarFile = getJarFileIfPossible(url); if (jarFile == null) { - return Collections.emptyList(); + return Collections.emptyList(); } try { return getUrlsFromManifestClassPathAttribute(url, jarFile); @@ -152,7 +152,7 @@ final class ChangeableUrls implements Iterable { JarFile jarFile) throws IOException { Manifest manifest = jarFile.getManifest(); if (manifest == null) { - return Collections.emptyList(); + return Collections.emptyList(); } String classPath = manifest.getMainAttributes() .getValue(Attributes.Name.CLASS_PATH); diff --git a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/autoconfigure/LocalDevToolsAutoConfigurationTests.java b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/autoconfigure/LocalDevToolsAutoConfigurationTests.java index fbd876d53e..0a36721313 100644 --- a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/autoconfigure/LocalDevToolsAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/autoconfigure/LocalDevToolsAutoConfigurationTests.java @@ -37,7 +37,6 @@ import org.springframework.boot.autoconfigure.web.ResourceProperties; import org.springframework.boot.autoconfigure.web.servlet.ServletWebServerFactoryAutoConfiguration; import org.springframework.boot.devtools.classpath.ClassPathChangedEvent; import org.springframework.boot.devtools.classpath.ClassPathFileSystemWatcher; -import org.springframework.boot.devtools.filewatch.ChangedFiles; import org.springframework.boot.devtools.livereload.LiveReloadServer; import org.springframework.boot.devtools.restart.FailureHandler; import org.springframework.boot.devtools.restart.MockRestartInitializer; @@ -146,7 +145,7 @@ public class LocalDevToolsAutoConfigurationTests { LiveReloadServer server = this.context.getBean(LiveReloadServer.class); reset(server); ClassPathChangedEvent event = new ClassPathChangedEvent(this.context, - Collections.emptySet(), false); + Collections.emptySet(), false); this.context.publishEvent(event); verify(server).triggerReload(); } @@ -157,7 +156,7 @@ public class LocalDevToolsAutoConfigurationTests { LiveReloadServer server = this.context.getBean(LiveReloadServer.class); reset(server); ClassPathChangedEvent event = new ClassPathChangedEvent(this.context, - Collections.emptySet(), true); + Collections.emptySet(), true); this.context.publishEvent(event); verify(server, never()).triggerReload(); } @@ -175,7 +174,7 @@ public class LocalDevToolsAutoConfigurationTests { public void restartTriggeredOnClassPathChangeWithRestart() throws Exception { this.context = initializeAndRun(Config.class); ClassPathChangedEvent event = new ClassPathChangedEvent(this.context, - Collections.emptySet(), true); + Collections.emptySet(), true); this.context.publishEvent(event); verify(this.mockRestarter.getMock()).restart(any(FailureHandler.class)); } @@ -184,7 +183,7 @@ public class LocalDevToolsAutoConfigurationTests { public void restartNotTriggeredOnClassPathChangeWithRestart() throws Exception { this.context = initializeAndRun(Config.class); ClassPathChangedEvent event = new ClassPathChangedEvent(this.context, - Collections.emptySet(), false); + Collections.emptySet(), false); this.context.publishEvent(event); verify(this.mockRestarter.getMock(), never()).restart(); } @@ -251,7 +250,7 @@ public class LocalDevToolsAutoConfigurationTests { private ConfigurableApplicationContext initializeAndRun(Class config, String... args) { - return initializeAndRun(config, Collections.emptyMap(), args); + return initializeAndRun(config, Collections.emptyMap(), args); } private ConfigurableApplicationContext initializeAndRun(Class config, diff --git a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/env/DevToolPropertiesIntegrationTests.java b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/env/DevToolPropertiesIntegrationTests.java index 64b02423a2..4ca1541be5 100644 --- a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/env/DevToolPropertiesIntegrationTests.java +++ b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/env/DevToolPropertiesIntegrationTests.java @@ -99,7 +99,7 @@ public class DevToolPropertiesIntegrationTests { SpringApplication application = new SpringApplication( BeanConditionConfiguration.class); application.setWebApplicationType(WebApplicationType.NONE); - application.setDefaultProperties(Collections.singletonMap( + application.setDefaultProperties(Collections.singletonMap( "spring.devtools.remote.secret", "donttell")); this.context = application.run(); this.context.getBean(MyBean.class); diff --git a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/server/DispatcherTests.java b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/server/DispatcherTests.java index 01fd235eb0..a79bee4d1f 100644 --- a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/server/DispatcherTests.java +++ b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/server/DispatcherTests.java @@ -79,7 +79,7 @@ public class DispatcherTests { public void accessManagerMustNotBeNull() throws Exception { this.thrown.expect(IllegalArgumentException.class); this.thrown.expectMessage("AccessManager must not be null"); - new Dispatcher(null, Collections.emptyList()); + new Dispatcher(null, Collections.emptyList()); } @Test diff --git a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/ImportsContextCustomizer.java b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/ImportsContextCustomizer.java index e8c8e9ea99..82f68d3b46 100644 --- a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/ImportsContextCustomizer.java +++ b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/ImportsContextCustomizer.java @@ -245,7 +245,7 @@ class ImportsContextCustomizer implements ContextCustomizer { Set> seen = new HashSet<>(); collectClassAnnotations(testClass, annotations, seen); Set determinedImports = determineImports(annotations, testClass); - this.key = Collections.unmodifiableSet( + this.key = Collections.unmodifiableSet( determinedImports != null ? determinedImports : annotations); } @@ -321,7 +321,7 @@ class ImportsContextCustomizer implements ContextCustomizer { return null; } // The source itself is the import - return Collections.singleton(source.getName()); + return Collections.singleton(source.getName()); } @SuppressWarnings("unchecked") diff --git a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/DefinitionsParser.java b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/DefinitionsParser.java index 0aa4befdfc..cdde8bc665 100644 --- a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/DefinitionsParser.java +++ b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/DefinitionsParser.java @@ -46,7 +46,7 @@ class DefinitionsParser { private final Map definitionFields; DefinitionsParser() { - this(Collections.emptySet()); + this(Collections.emptySet()); } DefinitionsParser(Collection existing) { diff --git a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/ImportsContextCustomizerTests.java b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/ImportsContextCustomizerTests.java index e354c62ae0..bb5e851712 100644 --- a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/ImportsContextCustomizerTests.java +++ b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/ImportsContextCustomizerTests.java @@ -162,7 +162,7 @@ public class ImportsContextCustomizerTests { @Override public Set determineImports(AnnotationMetadata metadata) { - return Collections.singleton(TestConfig.class.getName()); + return Collections.singleton(TestConfig.class.getName()); } } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-metadata/src/test/java/org/springframework/boot/configurationmetadata/JsonReaderTests.java b/spring-boot-project/spring-boot-tools/spring-boot-configuration-metadata/src/test/java/org/springframework/boot/configurationmetadata/JsonReaderTests.java index da8ebe832f..9d855943f8 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-metadata/src/test/java/org/springframework/boot/configurationmetadata/JsonReaderTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-configuration-metadata/src/test/java/org/springframework/boot/configurationmetadata/JsonReaderTests.java @@ -46,7 +46,7 @@ public class JsonReaderTests extends AbstractConfigurationMetadataTests { @Test public void invalidMetadata() throws IOException { - this.thrown.expectCause(CoreMatchers.instanceOf(JSONException.class)); + this.thrown.expectCause(CoreMatchers.instanceOf(JSONException.class)); readFor("invalid"); } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/metadata/ItemHint.java b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/metadata/ItemHint.java index ba7c2998be..fab3332fc8 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/metadata/ItemHint.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/metadata/ItemHint.java @@ -78,7 +78,7 @@ public class ItemHint implements Comparable { public static ItemHint newHint(String name, ValueHint... values) { return new ItemHint(name, Arrays.asList(values), - Collections.emptyList()); + Collections.emptyList()); } @Override diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationprocessor/ConfigurationMetadataAnnotationProcessorTests.java b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationprocessor/ConfigurationMetadataAnnotationProcessorTests.java index 2251735254..2fbbc9b548 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationprocessor/ConfigurationMetadataAnnotationProcessorTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationprocessor/ConfigurationMetadataAnnotationProcessorTests.java @@ -819,10 +819,10 @@ public class ConfigurationMetadataAnnotationProcessorTests { @Test public void mergingOfHintWithProvider() throws Exception { writeAdditionalHints(new ItemHint("simple.theName", - Collections.emptyList(), + Collections.emptyList(), Arrays.asList( new ItemHint.ValueProvider("first", - Collections.singletonMap("target", + Collections.singletonMap("target", "org.foo")), new ItemHint.ValueProvider("second", null)))); ConfigurationMetadata metadata = compile(SimpleProperties.class); diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationprocessor/metadata/JsonMarshallerTests.java b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationprocessor/metadata/JsonMarshallerTests.java index ca3a9ce782..ef8a3efed0 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationprocessor/metadata/JsonMarshallerTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationprocessor/metadata/JsonMarshallerTests.java @@ -57,7 +57,7 @@ public class JsonMarshallerTests { metadata.add(new ItemHint("d", null, Arrays.asList( new ItemHint.ValueProvider("first", - Collections.singletonMap("target", + Collections.singletonMap("target", "foo")), new ItemHint.ValueProvider("second", null)))); ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/test/java/org/springframework/boot/maven/DependencyFilterMojoTests.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/test/java/org/springframework/boot/maven/DependencyFilterMojoTests.java index 3b39ce4d11..d4c22962cf 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/test/java/org/springframework/boot/maven/DependencyFilterMojoTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/test/java/org/springframework/boot/maven/DependencyFilterMojoTests.java @@ -43,7 +43,7 @@ public class DependencyFilterMojoTests { @Test public void filterDependencies() throws MojoExecutionException { TestableDependencyFilterMojo mojo = new TestableDependencyFilterMojo( - Collections.emptyList(), "com.foo", "exclude-id"); + Collections.emptyList(), "com.foo", "exclude-id"); Artifact artifact = createArtifact("com.bar", "one"); Set artifacts = mojo.filterDependencies( @@ -56,7 +56,7 @@ public class DependencyFilterMojoTests { @Test public void filterGroupIdExactMatch() throws MojoExecutionException { TestableDependencyFilterMojo mojo = new TestableDependencyFilterMojo( - Collections.emptyList(), "com.foo", ""); + Collections.emptyList(), "com.foo", ""); Artifact artifact = createArtifact("com.foo.bar", "one"); Set artifacts = mojo.filterDependencies( @@ -69,7 +69,7 @@ public class DependencyFilterMojoTests { @Test public void filterScopeKeepOrder() throws MojoExecutionException { TestableDependencyFilterMojo mojo = new TestableDependencyFilterMojo( - Collections.emptyList(), "", "", + Collections.emptyList(), "", "", new ScopeFilter(null, Artifact.SCOPE_SYSTEM)); Artifact one = createArtifact("com.foo", "one"); Artifact two = createArtifact("com.foo", "two", Artifact.SCOPE_SYSTEM); @@ -81,7 +81,7 @@ public class DependencyFilterMojoTests { @Test public void filterArtifactIdKeepOrder() throws MojoExecutionException { TestableDependencyFilterMojo mojo = new TestableDependencyFilterMojo( - Collections.emptyList(), "", "one,three"); + Collections.emptyList(), "", "one,three"); Artifact one = createArtifact("com.foo", "one"); Artifact two = createArtifact("com.foo", "two"); Artifact three = createArtifact("com.foo", "three"); @@ -93,7 +93,7 @@ public class DependencyFilterMojoTests { @Test public void filterGroupIdKeepOrder() throws MojoExecutionException { TestableDependencyFilterMojo mojo = new TestableDependencyFilterMojo( - Collections.emptyList(), "com.foo", ""); + Collections.emptyList(), "com.foo", ""); Artifact one = createArtifact("com.foo", "one"); Artifact two = createArtifact("com.bar", "two"); Artifact three = createArtifact("com.bar", "three"); diff --git a/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/web/servlet/MockServletWebServer.java b/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/web/servlet/MockServletWebServer.java index 9037dccc6b..43ec5ce8bd 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/web/servlet/MockServletWebServer.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/web/servlet/MockServletWebServer.java @@ -93,7 +93,7 @@ public abstract class MockServletWebServer { given(this.servletContext.getInitParameter(anyString())).willAnswer( (invocation) -> initParameters.get(invocation.getArgument(0))); given(this.servletContext.getAttributeNames()) - .willReturn(MockServletWebServer.emptyEnumeration()); + .willReturn(MockServletWebServer.emptyEnumeration()); given(this.servletContext.getNamedDispatcher("default")) .willReturn(mock(RequestDispatcher.class)); for (Initializer initializer : this.initializers) { diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/ResourceBanner.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/ResourceBanner.java index 2091bd3577..8c5c8375d8 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/ResourceBanner.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/ResourceBanner.java @@ -130,7 +130,7 @@ public class ResourceBanner implements Banner { private PropertyResolver getTitleResolver(Class sourceClass) { MutablePropertySources sources = new MutablePropertySources(); String applicationTitle = getApplicationTitle(sourceClass); - Map titleMap = Collections.singletonMap( + Map titleMap = Collections.singletonMap( "application.title", (applicationTitle == null ? "" : applicationTitle)); sources.addFirst(new MapPropertySource("title", titleMap)); return new PropertySourcesPropertyResolver(sources); diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jdbc/metadata/CompositeDataSourcePoolMetadataProvider.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jdbc/metadata/CompositeDataSourcePoolMetadataProvider.java index 14b37eb2c9..dc0289ddd7 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jdbc/metadata/CompositeDataSourcePoolMetadataProvider.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jdbc/metadata/CompositeDataSourcePoolMetadataProvider.java @@ -43,7 +43,7 @@ public class CompositeDataSourcePoolMetadataProvider public CompositeDataSourcePoolMetadataProvider( Collection providers) { this.providers = (providers == null - ? Collections.emptyList() + ? Collections.emptyList() : Collections.unmodifiableList(new ArrayList<>(providers))); } diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jta/atomikos/AtomikosDependsOnBeanFactoryPostProcessor.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jta/atomikos/AtomikosDependsOnBeanFactoryPostProcessor.java index c3b9cbdde5..23dffd28d3 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jta/atomikos/AtomikosDependsOnBeanFactoryPostProcessor.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jta/atomikos/AtomikosDependsOnBeanFactoryPostProcessor.java @@ -98,7 +98,7 @@ public class AtomikosDependsOnBeanFactoryPostProcessor } private List asList(String[] array) { - return (array == null ? Collections.emptyList() : Arrays.asList(array)); + return (array == null ? Collections.emptyList() : Arrays.asList(array)); } @Override diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/client/RestTemplateBuilder.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/client/RestTemplateBuilder.java index dc224ee9e1..ac968268df 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/client/RestTemplateBuilder.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/client/RestTemplateBuilder.java @@ -111,8 +111,8 @@ public class RestTemplateBuilder { this.basicAuthorization = null; this.restTemplateCustomizers = Collections .unmodifiableSet(new LinkedHashSet<>(Arrays.asList(customizers))); - this.requestFactoryCustomizers = Collections.emptySet(); - this.interceptors = Collections.emptySet(); + this.requestFactoryCustomizers = Collections.emptySet(); + this.interceptors = Collections.emptySet(); } private RestTemplateBuilder(boolean detectRequestFactory, String rootUri, @@ -597,14 +597,14 @@ public class RestTemplateBuilder { private Set append(Set set, T addition) { Set result = new LinkedHashSet<>( - set == null ? Collections.emptySet() : set); + set == null ? Collections.emptySet() : set); result.add(addition); return Collections.unmodifiableSet(result); } private Set append(Set set, Collection additions) { Set result = new LinkedHashSet<>( - set == null ? Collections.emptySet() : set); + set == null ? Collections.emptySet() : set); result.addAll(additions); return Collections.unmodifiableSet(result); } diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/ResourceBannerTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/ResourceBannerTests.java index 28b071035e..68501ddf08 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/ResourceBannerTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/ResourceBannerTests.java @@ -120,7 +120,7 @@ public class ResourceBannerTests { ResourceBanner banner = new MockResourceBanner(resource, bootVersion, applicationVersion, applicationTitle); ConfigurableEnvironment environment = new MockEnvironment(); - Map source = Collections.singletonMap("a", "1"); + Map source = Collections.singletonMap("a", "1"); environment.getPropertySources().addLast(new MapPropertySource("map", source)); ByteArrayOutputStream out = new ByteArrayOutputStream(); banner.printBanner(environment, getClass(), new PrintStream(out)); diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/SpringApplicationTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/SpringApplicationTests.java index fa493d81f5..f49334c655 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/SpringApplicationTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/SpringApplicationTests.java @@ -485,7 +485,7 @@ public class SpringApplicationTests { application.setWebApplicationType(WebApplicationType.NONE); ConfigurableEnvironment environment = new StandardEnvironment(); environment.getPropertySources().addFirst(new MapPropertySource("commandLineArgs", - Collections.singletonMap("foo", "original"))); + Collections.singletonMap("foo", "original"))); application.setEnvironment(environment); this.context = application.run("--foo=bar", "--bar=foo"); assertThat(environment).has( diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/builder/SpringApplicationBuilderTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/builder/SpringApplicationBuilderTests.java index e364aedc68..bd952e6025 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/builder/SpringApplicationBuilderTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/builder/SpringApplicationBuilderTests.java @@ -79,7 +79,7 @@ public class SpringApplicationBuilderTests { public void propertiesAsMap() throws Exception { SpringApplicationBuilder application = new SpringApplicationBuilder() .sources(ExampleConfig.class).contextClass(StaticApplicationContext.class) - .properties(Collections.singletonMap("bar", "foo")); + .properties(Collections.singletonMap("bar", "foo")); this.context = application.run(); assertThat(this.context.getEnvironment().getProperty("bar")).isEqualTo("foo"); } diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigFileApplicationListenerTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigFileApplicationListenerTests.java index 3c8f189be0..80f16e3b08 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigFileApplicationListenerTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigFileApplicationListenerTests.java @@ -738,7 +738,7 @@ public class ConfigFileApplicationListenerTests { @Test public void addBeforeDefaultProperties() throws Exception { MapPropertySource defaultSource = new MapPropertySource("defaultProperties", - Collections.singletonMap("the.property", + Collections.singletonMap("the.property", "fromdefaultproperties")); this.environment.getPropertySources().addFirst(defaultSource); this.initializer.setSearchNames("testproperties"); diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/ConfigurationPropertiesBindingPostProcessorTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/ConfigurationPropertiesBindingPostProcessorTests.java index b156e5a12b..0d8426bed8 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/ConfigurationPropertiesBindingPostProcessorTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/ConfigurationPropertiesBindingPostProcessorTests.java @@ -211,7 +211,7 @@ public class ConfigurationPropertiesBindingPostProcessorTests { assertThat(first.getOne()).isEqualTo("foo"); source.put("example.one", "bar"); sources.addFirst(new MapPropertySource("extra", - Collections.singletonMap("example.two", "baz"))); + Collections.singletonMap("example.two", "baz"))); PrototypeBean second = this.context.getBean(PrototypeBean.class); assertThat(second.getOne()).isEqualTo("bar"); assertThat(second.getTwo()).isEqualTo("baz"); diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/EnableConfigurationPropertiesTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/EnableConfigurationPropertiesTests.java index b47ec7ded2..9e1219809d 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/EnableConfigurationPropertiesTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/EnableConfigurationPropertiesTests.java @@ -123,7 +123,7 @@ public class EnableConfigurationPropertiesTests { this.context.register(ExceptionIfInvalidTestConfiguration.class); TestPropertySourceUtils.addInlinedPropertiesToEnvironment(this.context, "name:foo"); - this.thrown.expectCause(Matchers.instanceOf(BindException.class)); + this.thrown.expectCause(Matchers.instanceOf(BindException.class)); this.context.refresh(); } diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/source/ConfigurationPropertySourcesTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/source/ConfigurationPropertySourcesTests.java index 1f962bf0b6..1a541c9360 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/source/ConfigurationPropertySourcesTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/source/ConfigurationPropertySourcesTests.java @@ -46,9 +46,9 @@ public class ConfigurationPropertySourcesTests { ConfigurableEnvironment environment = new StandardEnvironment(); MutablePropertySources sources = environment.getPropertySources(); sources.addLast(new SystemEnvironmentPropertySource("system", - Collections.singletonMap("SERVER_PORT", "1234"))); + Collections.singletonMap("SERVER_PORT", "1234"))); sources.addLast(new MapPropertySource("config", - Collections.singletonMap("server.port", "4568"))); + Collections.singletonMap("server.port", "4568"))); int size = sources.size(); ConfigurationPropertySources.attach(environment); assertThat(sources.size()).isEqualTo(size + 1); @@ -67,7 +67,7 @@ public class ConfigurationPropertySourcesTests { ConfigurableEnvironment environment = new StandardEnvironment(); MutablePropertySources sources = environment.getPropertySources(); sources.addFirst(new MapPropertySource("test", - Collections.singletonMap("a", "b"))); + Collections.singletonMap("a", "b"))); int expectedSize = sources.size(); ConfigurationPropertySources.attach(environment); assertThat(ConfigurationPropertySources.get(environment)).hasSize(expectedSize); @@ -89,7 +89,7 @@ public class ConfigurationPropertySourcesTests { public void fromPropertySourceShouldReturnSpringConfigurationPropertySource() throws Exception { PropertySource source = new MapPropertySource("foo", - Collections.singletonMap("foo", "bar")); + Collections.singletonMap("foo", "bar")); ConfigurationPropertySource configurationPropertySource = ConfigurationPropertySources .from(source).iterator().next(); assertThat(configurationPropertySource) @@ -100,9 +100,9 @@ public class ConfigurationPropertySourcesTests { public void fromPropertySourceShouldFlattenPropertySources() throws Exception { StandardEnvironment environment = new StandardEnvironment(); environment.getPropertySources().addFirst(new MapPropertySource("foo", - Collections.singletonMap("foo", "bar"))); + Collections.singletonMap("foo", "bar"))); environment.getPropertySources().addFirst(new MapPropertySource("far", - Collections.singletonMap("far", "far"))); + Collections.singletonMap("far", "far"))); MutablePropertySources sources = new MutablePropertySources(); sources.addFirst(new PropertySource("env", environment) { @@ -113,7 +113,7 @@ public class ConfigurationPropertySourcesTests { }); sources.addLast(new MapPropertySource("baz", - Collections.singletonMap("baz", "barf"))); + Collections.singletonMap("baz", "barf"))); Iterable configurationSources = ConfigurationPropertySources .from(sources); assertThat(configurationSources.iterator()).hasSize(5); diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/source/SpringConfigurationPropertySourcesTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/source/SpringConfigurationPropertySourcesTests.java index 786020ca75..01a390133a 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/source/SpringConfigurationPropertySourcesTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/source/SpringConfigurationPropertySourcesTests.java @@ -54,7 +54,7 @@ public class SpringConfigurationPropertySourcesTests { public void shouldAdaptPropertySource() throws Exception { MutablePropertySources sources = new MutablePropertySources(); sources.addFirst(new MapPropertySource("test", - Collections.singletonMap("a", "b"))); + Collections.singletonMap("a", "b"))); Iterator iterator = new SpringConfigurationPropertySources( sources).iterator(); ConfigurationPropertyName name = ConfigurationPropertyName.of("a"); @@ -67,7 +67,7 @@ public class SpringConfigurationPropertySourcesTests { public void shouldAdaptSystemEnvironmentPropertySource() throws Exception { MutablePropertySources sources = new MutablePropertySources(); sources.addLast(new SystemEnvironmentPropertySource("system", - Collections.singletonMap("SERVER_PORT", "1234"))); + Collections.singletonMap("SERVER_PORT", "1234"))); Iterator iterator = new SpringConfigurationPropertySources( sources).iterator(); ConfigurationPropertyName name = ConfigurationPropertyName.of("server.port"); @@ -80,11 +80,11 @@ public class SpringConfigurationPropertySourcesTests { public void shouldAdaptMultiplePropertySources() throws Exception { MutablePropertySources sources = new MutablePropertySources(); sources.addLast(new SystemEnvironmentPropertySource("system", - Collections.singletonMap("SERVER_PORT", "1234"))); + Collections.singletonMap("SERVER_PORT", "1234"))); sources.addLast(new MapPropertySource("test1", - Collections.singletonMap("server.po-rt", "4567"))); + Collections.singletonMap("server.po-rt", "4567"))); sources.addLast(new MapPropertySource("test2", - Collections.singletonMap("a", "b"))); + Collections.singletonMap("a", "b"))); Iterator iterator = new SpringConfigurationPropertySources( sources).iterator(); ConfigurationPropertyName name = ConfigurationPropertyName.of("server.port"); @@ -102,9 +102,9 @@ public class SpringConfigurationPropertySourcesTests { public void shouldFlattenEnvironment() throws Exception { StandardEnvironment environment = new StandardEnvironment(); environment.getPropertySources().addFirst(new MapPropertySource("foo", - Collections.singletonMap("foo", "bar"))); + Collections.singletonMap("foo", "bar"))); environment.getPropertySources().addFirst(new MapPropertySource("far", - Collections.singletonMap("far", "far"))); + Collections.singletonMap("far", "far"))); MutablePropertySources sources = new MutablePropertySources(); sources.addFirst(new PropertySource("env", environment) { @@ -115,7 +115,7 @@ public class SpringConfigurationPropertySourcesTests { }); sources.addLast(new MapPropertySource("baz", - Collections.singletonMap("baz", "barf"))); + Collections.singletonMap("baz", "barf"))); SpringConfigurationPropertySources configurationSources = new SpringConfigurationPropertySources( sources); assertThat(configurationSources.iterator()).hasSize(5); @@ -125,10 +125,10 @@ public class SpringConfigurationPropertySourcesTests { public void shouldTrackChanges() throws Exception { MutablePropertySources sources = new MutablePropertySources(); sources.addLast(new MapPropertySource("test1", - Collections.singletonMap("a", "b"))); + Collections.singletonMap("a", "b"))); assertThat(new SpringConfigurationPropertySources(sources).iterator()).hasSize(1); sources.addLast(new MapPropertySource("test2", - Collections.singletonMap("b", "c"))); + Collections.singletonMap("b", "c"))); assertThat(new SpringConfigurationPropertySources(sources).iterator()).hasSize(2); } diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/client/RestTemplateBuilderTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/client/RestTemplateBuilderTests.java index 96dd829596..4d7e856569 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/client/RestTemplateBuilderTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/client/RestTemplateBuilderTests.java @@ -185,7 +185,7 @@ public class RestTemplateBuilderTests { @Test public void defaultMessageConvertersShouldSetDefaultList() throws Exception { RestTemplate template = new RestTemplate( - Collections.>singletonList( + Collections.singletonList( new StringHttpMessageConverter())); this.builder.defaultMessageConverters().configure(template); assertThat(template.getMessageConverters()) @@ -195,7 +195,7 @@ public class RestTemplateBuilderTests { @Test public void defaultMessageConvertersShouldClearExisting() throws Exception { RestTemplate template = new RestTemplate( - Collections.>singletonList( + Collections.singletonList( new StringHttpMessageConverter())); this.builder.additionalMessageConverters(this.messageConverter) .defaultMessageConverters().configure(template); diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/support/SpringBootServletInitializerTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/support/SpringBootServletInitializerTests.java index 1731555d38..b340fa4e97 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/support/SpringBootServletInitializerTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/support/SpringBootServletInitializerTests.java @@ -138,7 +138,7 @@ public class SpringBootServletInitializerTests { given(servletContext.getInitParameter("spring.profiles.active")) .willReturn("from-servlet-context"); given(servletContext.getAttributeNames()) - .willReturn(Collections.enumeration(Collections.emptyList())); + .willReturn(Collections.enumeration(Collections.emptyList())); try (ConfigurableApplicationContext context = (ConfigurableApplicationContext) new PropertySourceVerifyingSpringBootServletInitializer() .createRootApplicationContext(servletContext)) { assertThat(context.getEnvironment().getActiveProfiles()) diff --git a/spring-boot-samples/spring-boot-sample-atmosphere/src/main/java/sample/atmosphere/SampleAtmosphereApplication.java b/spring-boot-samples/spring-boot-sample-atmosphere/src/main/java/sample/atmosphere/SampleAtmosphereApplication.java index aac4c108eb..8737cd8d14 100644 --- a/spring-boot-samples/spring-boot-sample-atmosphere/src/main/java/sample/atmosphere/SampleAtmosphereApplication.java +++ b/spring-boot-samples/spring-boot-sample-atmosphere/src/main/java/sample/atmosphere/SampleAtmosphereApplication.java @@ -74,7 +74,7 @@ public class SampleAtmosphereApplication { @Override public void onStartup(ServletContext servletContext) throws ServletException { - onStartup(Collections.>emptySet(), servletContext); + onStartup(Collections.emptySet(), servletContext); } }