From 3e0f2f227ca5205009bedfcdb7cbc1b66d69e64a 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 --- .../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 +- .../SampleAtmosphereApplication.java | 2 +- .../main/java/sample/jooq/domain/Author.java | 2 +- .../main/java/sample/jooq/domain/Book.java | 4 ++-- .../java/sample/jooq/domain/BookStore.java | 2 +- .../sample/jooq/domain/BookToBookStore.java | 4 ++-- .../sample/jooq/domain/DefaultCatalog.java | 2 +- .../java/sample/jooq/domain/Language.java | 2 +- .../main/java/sample/jooq/domain/Public.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 +- 68 files changed, 114 insertions(+), 117 deletions(-) diff --git a/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/ManagementServerFactoryCustomizer.java b/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/ManagementServerFactoryCustomizer.java index 030b7dbc09ce..c1a626a11889 100644 --- a/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/ManagementServerFactoryCustomizer.java +++ b/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/ManagementServerFactoryCustomizer.java @@ -67,7 +67,7 @@ public final void customize(T factory) { // the same place) webServerFactoryCustomizer.customize(factory); // Then reset the error pages - factory.setErrorPages(Collections.emptySet()); + factory.setErrorPages(Collections.emptySet()); // and add the management-specific bits customize(factory, managementServerProperties, serverProperties); } diff --git a/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/servlet/RequestMappingEndpointTests.java b/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/servlet/RequestMappingEndpointTests.java index ab537695ec3f..38b05f4d43e5 100644 --- a/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/servlet/RequestMappingEndpointTests.java +++ b/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/servlet/RequestMappingEndpointTests.java @@ -36,7 +36,6 @@ 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; @@ -58,7 +57,7 @@ public void concreteUrlMappings() { 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") @@ -119,7 +118,7 @@ public void beanMethodMappings() { 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-actuator/src/main/java/org/springframework/boot/actuate/context/ShutdownEndpoint.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/context/ShutdownEndpoint.java index 53e5a1964f15..06cb33b080d2 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/context/ShutdownEndpoint.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/context/ShutdownEndpoint.java @@ -39,11 +39,11 @@ 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-actuator/src/main/java/org/springframework/boot/actuate/context/properties/ConfigurationPropertiesReportEndpoint.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/context/properties/ConfigurationPropertiesReportEndpoint.java index fdaf881c516f..91776956a2cd 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/context/properties/ConfigurationPropertiesReportEndpoint.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/context/properties/ConfigurationPropertiesReportEndpoint.java @@ -154,7 +154,7 @@ private Map safeSerialize(ObjectMapper mapper, Object bean, 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-actuator/src/test/java/org/springframework/boot/actuate/audit/AuditEventsEndpointWebIntegrationTests.java b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/audit/AuditEventsEndpointWebIntegrationTests.java index 6383ccadcb71..dd292d24a102 100644 --- a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/audit/AuditEventsEndpointWebIntegrationTests.java +++ b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/audit/AuditEventsEndpointWebIntegrationTests.java @@ -106,7 +106,7 @@ public AuditEventsWebEndpointExtension auditEventsWebEndpointExtension( 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-actuator/src/test/java/org/springframework/boot/actuate/audit/listener/AuditListenerTests.java b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/audit/listener/AuditListenerTests.java index eb73839737fb..38753969d8ee 100644 --- a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/audit/listener/AuditListenerTests.java +++ b/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-actuator/src/test/java/org/springframework/boot/actuate/security/AuthorizationAuditListenerTests.java b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/security/AuthorizationAuditListenerTests.java index e1410f3b37ba..99cadc5c5179 100644 --- a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/security/AuthorizationAuditListenerTests.java +++ b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/security/AuthorizationAuditListenerTests.java @@ -25,7 +25,6 @@ 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 void init() { 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 void testAuthenticationCredentialsNotFound() { 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 void testDetailsAreIncludedInAuditEvent() throws Exception { 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-actuator/src/test/java/org/springframework/boot/actuate/trace/InMemoryTraceRepositoryTests.java b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/trace/InMemoryTraceRepositoryTests.java index e253f81c9760..e61ce07b644a 100644 --- a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/trace/InMemoryTraceRepositoryTests.java +++ b/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 void capacityLimited() { 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-actuator/src/test/java/org/springframework/boot/actuate/trace/TraceEndpointTests.java b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/trace/TraceEndpointTests.java index 5d3af1538bc3..938c96bcce0b 100644 --- a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/trace/TraceEndpointTests.java +++ b/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-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigurationPackages.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigurationPackages.java index ed769ee4ed3b..963af726516d 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigurationPackages.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigurationPackages.java @@ -131,7 +131,7 @@ public void registerBeanDefinitions(AnnotationMetadata metadata, @Override public Set determineImports(AnnotationMetadata metadata) { - return Collections.singleton(new PackageImport(metadata)); + return Collections.singleton(new PackageImport(metadata)); } } diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigurationSorter.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigurationSorter.java index b6c5570cdaea..f5afa6d91c90 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigurationSorter.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigurationSorter.java @@ -174,7 +174,7 @@ private int getOrder() { 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 @@ private Set readBefore() { 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-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/ImportAutoConfigurationImportSelector.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/ImportAutoConfigurationImportSelector.java index c3d3ce0675d8..5857da091a9a 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 @@ -61,7 +61,7 @@ public Set determineImports(AnnotationMetadata metadata) { 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-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/CacheManagerCustomizers.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/CacheManagerCustomizers.java index a9b57add7b99..489aebd600c6 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/CacheManagerCustomizers.java +++ b/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-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/domain/EntityScanner.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/domain/EntityScanner.java index e23afb80b881..502d5d9f5717 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/domain/EntityScanner.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/domain/EntityScanner.java @@ -62,7 +62,7 @@ public final Set> scan(Class... annotationTypes) 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-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/http/HttpMessageConverters.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/http/HttpMessageConverters.java index 44cef8b71365..1f9150a15f4b 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/http/HttpMessageConverters.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/http/HttpMessageConverters.java @@ -104,7 +104,7 @@ public HttpMessageConverters(boolean addDefaultConverters, 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-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/http/HttpMessageConvertersAutoConfiguration.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/http/HttpMessageConvertersAutoConfiguration.java index 7cb9ae218f53..50c1c5c2a0cb 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/http/HttpMessageConvertersAutoConfiguration.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/http/HttpMessageConvertersAutoConfiguration.java @@ -69,7 +69,7 @@ public 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-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQConnectionFactoryFactory.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQConnectionFactoryFactory.java index e5edb78f749e..1b44cf71acf2 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQConnectionFactoryFactory.java +++ b/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-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/ldap/LdapAutoConfiguration.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/ldap/LdapAutoConfiguration.java index d8f3acd6e8ad..672689dd8c19 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/ldap/LdapAutoConfiguration.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/ldap/LdapAutoConfiguration.java @@ -57,7 +57,7 @@ public ContextSource ldapContextSource() { 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-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 725be1bd52a2..45f390368191 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 @@ -258,7 +258,7 @@ private ToStringFriendlyFeatureAwareVersion(String version, 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-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/error/BasicErrorController.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/error/BasicErrorController.java index ba3616421e84..41e5eb131c7c 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/error/BasicErrorController.java +++ b/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-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/AutoConfigurationImportSelectorTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/AutoConfigurationImportSelectorTests.java index 5c2f94603a35..f2c8875fc098 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/AutoConfigurationImportSelectorTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/AutoConfigurationImportSelectorTests.java @@ -248,7 +248,7 @@ protected List getAutoConfigurationImportFilters( @Override protected List getAutoConfigurationImportListeners() { - return Collections.singletonList( + return Collections.singletonList( (event) -> this.lastEvent = event); } diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfigurationTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfigurationTests.java index e80c26a434e1..7c765abbf602 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfigurationTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfigurationTests.java @@ -936,7 +936,7 @@ static class JCacheCustomCacheManager { 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-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/OnClassConditionAutoConfigurationImportFilterTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/OnClassConditionAutoConfigurationImportFilterTests.java index a8f34dd52ee0..1d53c5267b59 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/OnClassConditionAutoConfigurationImportFilterTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/OnClassConditionAutoConfigurationImportFilterTests.java @@ -76,10 +76,10 @@ private AutoConfigurationMetadata getAutoConfigurationMetadata() { 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-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/domain/EntityScanPackagesTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/domain/EntityScanPackagesTests.java index 0dac3bec3584..fd546ae393a4 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/domain/EntityScanPackagesTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/domain/EntityScanPackagesTests.java @@ -92,7 +92,7 @@ public void registerFromCollectionWhenRegistryIsNullShouldThrowException() 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-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastJpaDependencyAutoConfigurationTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastJpaDependencyAutoConfigurationTests.java index 79a01606c3f3..3ece48df6afb 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastJpaDependencyAutoConfigurationTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastJpaDependencyAutoConfigurationTests.java @@ -103,7 +103,7 @@ private List entityManagerFactoryDependencies( .getSourceApplicationContext()).getBeanDefinition("entityManagerFactory") .getDependsOn(); return dependsOn != null ? Arrays.asList(dependsOn) - : Collections.emptyList(); + : Collections.emptyList(); } @Configuration diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQPropertiesTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQPropertiesTests.java index fb3bb861ccc7..e18e3ec0a7d0 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQPropertiesTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQPropertiesTests.java @@ -88,7 +88,7 @@ public void setTrustedPackages() { private ActiveMQConnectionFactoryFactory createFactory( ActiveMQProperties properties) { return new ActiveMQConnectionFactoryFactory(properties, - Collections.emptyList()); + Collections.emptyList()); } } diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jndi/JndiPropertiesHidingClassLoader.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jndi/JndiPropertiesHidingClassLoader.java index 10d7fccb21c6..effdef127810 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jndi/JndiPropertiesHidingClassLoader.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jndi/JndiPropertiesHidingClassLoader.java @@ -36,7 +36,7 @@ public JndiPropertiesHidingClassLoader(ClassLoader parent) { @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-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mobile/DeviceDelegatingViewResolverAutoConfigurationTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mobile/DeviceDelegatingViewResolverAutoConfigurationTests.java index 64686e8151be..729c95b8640b 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mobile/DeviceDelegatingViewResolverAutoConfigurationTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mobile/DeviceDelegatingViewResolverAutoConfigurationTests.java @@ -89,7 +89,7 @@ public void deviceDelegatingJspResourceViewResolver() throws Exception { @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 void deviceDelegatingFreeMarkerViewResolver() throws Exception { @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 void deviceDelegatingGroovyMarkupViewResolver() throws Exception { @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 void deviceDelegatingMustacheViewResolver() throws Exception { @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-cli/src/main/java/org/springframework/boot/cli/DefaultCommandFactory.java b/spring-boot-cli/src/main/java/org/springframework/boot/cli/DefaultCommandFactory.java index 80ef7dff6a23..bf01b5a54e69 100644 --- a/spring-boot-cli/src/main/java/org/springframework/boot/cli/DefaultCommandFactory.java +++ b/spring-boot-cli/src/main/java/org/springframework/boot/cli/DefaultCommandFactory.java @@ -38,7 +38,7 @@ */ 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-cli/src/main/java/org/springframework/boot/cli/compiler/dependencies/Dependency.java b/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/dependencies/Dependency.java index 70aa289daaef..34c8f16fb7a7 100644 --- a/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/dependencies/Dependency.java +++ b/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-cli/src/main/java/org/springframework/boot/groovy/GroovyTemplate.java b/spring-boot-cli/src/main/java/org/springframework/boot/groovy/GroovyTemplate.java index be5aca978b49..5988526d8889 100644 --- a/spring-boot-cli/src/main/java/org/springframework/boot/groovy/GroovyTemplate.java +++ b/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-cli/src/test/java/cli/command/CustomCommandFactory.java b/spring-boot-cli/src/test/java/cli/command/CustomCommandFactory.java index 081d7284ce67..eb83829707a0 100644 --- a/spring-boot-cli/src/test/java/cli/command/CustomCommandFactory.java +++ b/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-cli/src/test/java/org/springframework/boot/cli/command/init/ProjectGenerationRequestTests.java b/spring-boot-cli/src/test/java/org/springframework/boot/cli/command/init/ProjectGenerationRequestTests.java index 1dec8c59eac9..470a14ed8deb 100644 --- a/spring-boot-cli/src/test/java/org/springframework/boot/cli/command/init/ProjectGenerationRequestTests.java +++ b/spring-boot-cli/src/test/java/org/springframework/boot/cli/command/init/ProjectGenerationRequestTests.java @@ -44,7 +44,7 @@ public class ProjectGenerationRequestTests { public static final Map EMPTY_TAGS = Collections - .emptyMap(); + .emptyMap(); @Rule public final ExpectedException thrown = ExpectedException.none(); diff --git a/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/ChangeableUrls.java b/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/ChangeableUrls.java index 2a10f38b3c78..f098982d4589 100644 --- a/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/ChangeableUrls.java +++ b/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/ChangeableUrls.java @@ -123,7 +123,7 @@ private static URL toURL(String classPathEntry) { 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 @@ private static List getUrlsFromManifestClassPathAttribute(URL jarUrl, 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-devtools/src/test/java/org/springframework/boot/devtools/autoconfigure/LocalDevToolsAutoConfigurationTests.java b/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/autoconfigure/LocalDevToolsAutoConfigurationTests.java index fbd876d53e8f..0a367213132f 100644 --- a/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/autoconfigure/LocalDevToolsAutoConfigurationTests.java +++ b/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/autoconfigure/LocalDevToolsAutoConfigurationTests.java @@ -37,7 +37,6 @@ 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 void liveReloadTriggeredOnClassPathChangeWithoutRestart() throws Exceptio 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 void liveReloadNotTriggeredOnClassPathChangeWithRestart() throws Exceptio 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 void liveReloadDisabled() throws Exception { 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 void restartTriggeredOnClassPathChangeWithRestart() throws Exception { 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 void devToolsSwitchesJspServletToDevelopmentMode() { 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-devtools/src/test/java/org/springframework/boot/devtools/env/DevToolPropertiesIntegrationTests.java b/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/env/DevToolPropertiesIntegrationTests.java index 64b02423a262..4ca1541be548 100644 --- a/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/env/DevToolPropertiesIntegrationTests.java +++ b/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/env/DevToolPropertiesIntegrationTests.java @@ -99,7 +99,7 @@ public void postProcessWhenRestarterDisabledAndRemoteSecretSetShouldAddPropertyS 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-devtools/src/test/java/org/springframework/boot/devtools/remote/server/DispatcherTests.java b/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/server/DispatcherTests.java index 01fd235eb0f6..a79bee4d1f6f 100644 --- a/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/server/DispatcherTests.java +++ b/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/server/DispatcherTests.java @@ -79,7 +79,7 @@ public void setup() { 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-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 aac4c108eb49..8737cd8d146a 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 @@ private static class EmbeddedAtmosphereInitializer extends ContainerInitializer @Override public void onStartup(ServletContext servletContext) throws ServletException { - onStartup(Collections.>emptySet(), servletContext); + onStartup(Collections.emptySet(), servletContext); } } diff --git a/spring-boot-samples/spring-boot-sample-jooq/gensrc/main/java/sample/jooq/domain/Author.java b/spring-boot-samples/spring-boot-sample-jooq/gensrc/main/java/sample/jooq/domain/Author.java index 70f5bae4908b..5c1a5bd984d5 100644 --- a/spring-boot-samples/spring-boot-sample-jooq/gensrc/main/java/sample/jooq/domain/Author.java +++ b/spring-boot-samples/spring-boot-sample-jooq/gensrc/main/java/sample/jooq/domain/Author.java @@ -119,7 +119,7 @@ public UniqueKey getPrimaryKey() { */ @Override public List> getKeys() { - return Arrays.>asList(Keys.CONSTRAINT_7); + return Arrays.asList(Keys.CONSTRAINT_7); } /** diff --git a/spring-boot-samples/spring-boot-sample-jooq/gensrc/main/java/sample/jooq/domain/Book.java b/spring-boot-samples/spring-boot-sample-jooq/gensrc/main/java/sample/jooq/domain/Book.java index 8b90b902c495..ddcd64b0054d 100644 --- a/spring-boot-samples/spring-boot-sample-jooq/gensrc/main/java/sample/jooq/domain/Book.java +++ b/spring-boot-samples/spring-boot-sample-jooq/gensrc/main/java/sample/jooq/domain/Book.java @@ -113,7 +113,7 @@ public UniqueKey getPrimaryKey() { */ @Override public List> getKeys() { - return Arrays.>asList(Keys.CONSTRAINT_1); + return Arrays.asList(Keys.CONSTRAINT_1); } /** @@ -121,7 +121,7 @@ public List> getKeys() { */ @Override public List> getReferences() { - return Arrays.>asList(Keys.FK_BOOK_AUTHOR, + return Arrays.asList(Keys.FK_BOOK_AUTHOR, Keys.FK_BOOK_LANGUAGE); } diff --git a/spring-boot-samples/spring-boot-sample-jooq/gensrc/main/java/sample/jooq/domain/BookStore.java b/spring-boot-samples/spring-boot-sample-jooq/gensrc/main/java/sample/jooq/domain/BookStore.java index 6bb06ff4a4ef..6fd0f25b73d6 100644 --- a/spring-boot-samples/spring-boot-sample-jooq/gensrc/main/java/sample/jooq/domain/BookStore.java +++ b/spring-boot-samples/spring-boot-sample-jooq/gensrc/main/java/sample/jooq/domain/BookStore.java @@ -80,7 +80,7 @@ public Schema getSchema() { */ @Override public List> getKeys() { - return Arrays.>asList(Keys.CONSTRAINT_F); + return Arrays.asList(Keys.CONSTRAINT_F); } /** diff --git a/spring-boot-samples/spring-boot-sample-jooq/gensrc/main/java/sample/jooq/domain/BookToBookStore.java b/spring-boot-samples/spring-boot-sample-jooq/gensrc/main/java/sample/jooq/domain/BookToBookStore.java index 87dcc42d625e..44c6be89f30b 100644 --- a/spring-boot-samples/spring-boot-sample-jooq/gensrc/main/java/sample/jooq/domain/BookToBookStore.java +++ b/spring-boot-samples/spring-boot-sample-jooq/gensrc/main/java/sample/jooq/domain/BookToBookStore.java @@ -101,7 +101,7 @@ public UniqueKey getPrimaryKey() { */ @Override public List> getKeys() { - return Arrays.>asList(Keys.CONSTRAINT_2); + return Arrays.asList(Keys.CONSTRAINT_2); } /** @@ -109,7 +109,7 @@ public List> getKeys() { */ @Override public List> getReferences() { - return Arrays.>asList(Keys.FK_B2BS_BOOK_STORE, + return Arrays.asList(Keys.FK_B2BS_BOOK_STORE, Keys.FK_B2BS_BOOK); } diff --git a/spring-boot-samples/spring-boot-sample-jooq/gensrc/main/java/sample/jooq/domain/DefaultCatalog.java b/spring-boot-samples/spring-boot-sample-jooq/gensrc/main/java/sample/jooq/domain/DefaultCatalog.java index 8d7d9f5aba64..a2130651e8a6 100644 --- a/spring-boot-samples/spring-boot-sample-jooq/gensrc/main/java/sample/jooq/domain/DefaultCatalog.java +++ b/spring-boot-samples/spring-boot-sample-jooq/gensrc/main/java/sample/jooq/domain/DefaultCatalog.java @@ -47,6 +47,6 @@ public final List getSchemas() { } private final List getSchemas0() { - return Arrays.asList(Public.PUBLIC); + return Arrays.asList(Public.PUBLIC); } } diff --git a/spring-boot-samples/spring-boot-sample-jooq/gensrc/main/java/sample/jooq/domain/Language.java b/spring-boot-samples/spring-boot-sample-jooq/gensrc/main/java/sample/jooq/domain/Language.java index 6c901145497e..884ace572352 100644 --- a/spring-boot-samples/spring-boot-sample-jooq/gensrc/main/java/sample/jooq/domain/Language.java +++ b/spring-boot-samples/spring-boot-sample-jooq/gensrc/main/java/sample/jooq/domain/Language.java @@ -100,7 +100,7 @@ public UniqueKey getPrimaryKey() { */ @Override public List> getKeys() { - return Arrays.>asList(Keys.CONSTRAINT_C); + return Arrays.asList(Keys.CONSTRAINT_C); } /** diff --git a/spring-boot-samples/spring-boot-sample-jooq/gensrc/main/java/sample/jooq/domain/Public.java b/spring-boot-samples/spring-boot-sample-jooq/gensrc/main/java/sample/jooq/domain/Public.java index 518929650f29..9eb8a852ed3d 100644 --- a/spring-boot-samples/spring-boot-sample-jooq/gensrc/main/java/sample/jooq/domain/Public.java +++ b/spring-boot-samples/spring-boot-sample-jooq/gensrc/main/java/sample/jooq/domain/Public.java @@ -76,7 +76,7 @@ public final List> getTables() { } private final List> getTables0() { - return Arrays.>asList(Language.LANGUAGE, Author.AUTHOR, Book.BOOK, + return Arrays.asList(Language.LANGUAGE, Author.AUTHOR, Book.BOOK, BookStore.BOOK_STORE, BookToBookStore.BOOK_TO_BOOK_STORE); } } diff --git a/spring-boot-test/src/main/java/org/springframework/boot/test/context/ImportsContextCustomizer.java b/spring-boot-test/src/main/java/org/springframework/boot/test/context/ImportsContextCustomizer.java index e8c8e9ea99b4..82f68d3b467e 100644 --- a/spring-boot-test/src/main/java/org/springframework/boot/test/context/ImportsContextCustomizer.java +++ b/spring-boot-test/src/main/java/org/springframework/boot/test/context/ImportsContextCustomizer.java @@ -245,7 +245,7 @@ static class ContextCustomizerKey { 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 @@ private Set determineImports(Class source, 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-test/src/main/java/org/springframework/boot/test/mock/mockito/DefinitionsParser.java b/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/DefinitionsParser.java index 99348cb18867..e6c99fc1f0d3 100644 --- a/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/DefinitionsParser.java +++ b/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-test/src/test/java/org/springframework/boot/test/context/ImportsContextCustomizerTests.java b/spring-boot-test/src/test/java/org/springframework/boot/test/context/ImportsContextCustomizerTests.java index e354c62ae074..bb5e8517124a 100644 --- a/spring-boot-test/src/test/java/org/springframework/boot/test/context/ImportsContextCustomizerTests.java +++ b/spring-boot-test/src/test/java/org/springframework/boot/test/context/ImportsContextCustomizerTests.java @@ -162,7 +162,7 @@ public String[] selectImports(AnnotationMetadata arg0) { @Override public Set determineImports(AnnotationMetadata metadata) { - return Collections.singleton(TestConfig.class.getName()); + return Collections.singleton(TestConfig.class.getName()); } } diff --git a/spring-boot-tools/spring-boot-configuration-metadata/src/test/java/org/springframework/boot/configurationmetadata/JsonReaderTests.java b/spring-boot-tools/spring-boot-configuration-metadata/src/test/java/org/springframework/boot/configurationmetadata/JsonReaderTests.java index da8ebe832f96..9d855943f82f 100644 --- a/spring-boot-tools/spring-boot-configuration-metadata/src/test/java/org/springframework/boot/configurationmetadata/JsonReaderTests.java +++ b/spring-boot-tools/spring-boot-configuration-metadata/src/test/java/org/springframework/boot/configurationmetadata/JsonReaderTests.java @@ -46,7 +46,7 @@ public void emptyMetadata() throws IOException { @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-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/metadata/ItemHint.java b/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/metadata/ItemHint.java index ba7c2998bea1..fab3332fc84a 100644 --- a/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/metadata/ItemHint.java +++ b/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/metadata/ItemHint.java @@ -78,7 +78,7 @@ public int compareTo(ItemHint other) { 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-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationprocessor/ConfigurationMetadataAnnotationProcessorTests.java b/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationprocessor/ConfigurationMetadataAnnotationProcessorTests.java index 2251735254e1..2fbbc9b54846 100644 --- a/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationprocessor/ConfigurationMetadataAnnotationProcessorTests.java +++ b/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationprocessor/ConfigurationMetadataAnnotationProcessorTests.java @@ -819,10 +819,10 @@ public void mergingOfHintWithNonCanonicalName() throws Exception { @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-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationprocessor/metadata/JsonMarshallerTests.java b/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationprocessor/metadata/JsonMarshallerTests.java index ca3a9ce782b2..ef8a3efed0a9 100644 --- a/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationprocessor/metadata/JsonMarshallerTests.java +++ b/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationprocessor/metadata/JsonMarshallerTests.java @@ -57,7 +57,7 @@ public void marshallAndUnmarshal() throws Exception { 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-tools/spring-boot-maven-plugin/src/test/java/org/springframework/boot/maven/DependencyFilterMojoTests.java b/spring-boot-tools/spring-boot-maven-plugin/src/test/java/org/springframework/boot/maven/DependencyFilterMojoTests.java index 3b39ce4d113e..d4c22962cf3b 100644 --- a/spring-boot-tools/spring-boot-maven-plugin/src/test/java/org/springframework/boot/maven/DependencyFilterMojoTests.java +++ b/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 void filterDependencies() throws MojoExecutionException { @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 void filterGroupIdExactMatch() throws MojoExecutionException { @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 void filterScopeKeepOrder() throws MojoExecutionException { @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 void filterArtifactIdKeepOrder() throws MojoExecutionException { @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-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/web/servlet/MockServletWebServer.java b/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/web/servlet/MockServletWebServer.java index 9037dccc6b62..43ec5ce8bd7b 100644 --- a/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/web/servlet/MockServletWebServer.java +++ b/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/web/servlet/MockServletWebServer.java @@ -93,7 +93,7 @@ private void initialize() { 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/src/main/java/org/springframework/boot/ResourceBanner.java b/spring-boot/src/main/java/org/springframework/boot/ResourceBanner.java index 2091bd3577da..8c5c8375d819 100644 --- a/spring-boot/src/main/java/org/springframework/boot/ResourceBanner.java +++ b/spring-boot/src/main/java/org/springframework/boot/ResourceBanner.java @@ -130,7 +130,7 @@ private PropertyResolver getAnsiResolver() { 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/src/main/java/org/springframework/boot/jdbc/metadata/CompositeDataSourcePoolMetadataProvider.java b/spring-boot/src/main/java/org/springframework/boot/jdbc/metadata/CompositeDataSourcePoolMetadataProvider.java index 14b37eb2c9c6..dc0289ddd7c3 100644 --- a/spring-boot/src/main/java/org/springframework/boot/jdbc/metadata/CompositeDataSourcePoolMetadataProvider.java +++ b/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/src/main/java/org/springframework/boot/jta/atomikos/AtomikosDependsOnBeanFactoryPostProcessor.java b/spring-boot/src/main/java/org/springframework/boot/jta/atomikos/AtomikosDependsOnBeanFactoryPostProcessor.java index c3b9cbdde5cc..23dffd28d369 100644 --- a/spring-boot/src/main/java/org/springframework/boot/jta/atomikos/AtomikosDependsOnBeanFactoryPostProcessor.java +++ b/spring-boot/src/main/java/org/springframework/boot/jta/atomikos/AtomikosDependsOnBeanFactoryPostProcessor.java @@ -98,7 +98,7 @@ private String[] getBeanNamesForType(ConfigurableListableBeanFactory beanFactory } 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/src/main/java/org/springframework/boot/web/client/RestTemplateBuilder.java b/spring-boot/src/main/java/org/springframework/boot/web/client/RestTemplateBuilder.java index dc224ee9e1f8..ac968268dfc7 100644 --- a/spring-boot/src/main/java/org/springframework/boot/web/client/RestTemplateBuilder.java +++ b/spring-boot/src/main/java/org/springframework/boot/web/client/RestTemplateBuilder.java @@ -111,8 +111,8 @@ public RestTemplateBuilder(RestTemplateCustomizer... customizers) { 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 @@ private ClientHttpRequestFactory detectRequestFactory() { 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/src/test/java/org/springframework/boot/ResourceBannerTests.java b/spring-boot/src/test/java/org/springframework/boot/ResourceBannerTests.java index 3cc4509f59e9..ce477ffc6f69 100644 --- a/spring-boot/src/test/java/org/springframework/boot/ResourceBannerTests.java +++ b/spring-boot/src/test/java/org/springframework/boot/ResourceBannerTests.java @@ -120,7 +120,7 @@ private String printBanner(Resource resource, String bootVersion, 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/src/test/java/org/springframework/boot/SpringApplicationTests.java b/spring-boot/src/test/java/org/springframework/boot/SpringApplicationTests.java index fa493d81f5e4..f49334c6550c 100644 --- a/spring-boot/src/test/java/org/springframework/boot/SpringApplicationTests.java +++ b/spring-boot/src/test/java/org/springframework/boot/SpringApplicationTests.java @@ -485,7 +485,7 @@ public void commandLinePropertySourceEnhancesEnvironment() throws Exception { 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/src/test/java/org/springframework/boot/builder/SpringApplicationBuilderTests.java b/spring-boot/src/test/java/org/springframework/boot/builder/SpringApplicationBuilderTests.java index e364aedc68f9..bd952e6025b1 100644 --- a/spring-boot/src/test/java/org/springframework/boot/builder/SpringApplicationBuilderTests.java +++ b/spring-boot/src/test/java/org/springframework/boot/builder/SpringApplicationBuilderTests.java @@ -79,7 +79,7 @@ public void profileAndProperties() throws Exception { 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/src/test/java/org/springframework/boot/context/config/ConfigFileApplicationListenerTests.java b/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigFileApplicationListenerTests.java index 3c8f189be0b1..80f16e3b083e 100644 --- a/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigFileApplicationListenerTests.java +++ b/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigFileApplicationListenerTests.java @@ -738,7 +738,7 @@ public void profileSubDocumentInDifferentProfileSpecificFile() throws Exception @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/src/test/java/org/springframework/boot/context/properties/ConfigurationPropertiesBindingPostProcessorTests.java b/spring-boot/src/test/java/org/springframework/boot/context/properties/ConfigurationPropertiesBindingPostProcessorTests.java index a877e11b992a..01336a5c57bf 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 @@ -223,7 +223,7 @@ public void rebindableConfigurationProperties() throws Exception { 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/src/test/java/org/springframework/boot/context/properties/EnableConfigurationPropertiesTests.java b/spring-boot/src/test/java/org/springframework/boot/context/properties/EnableConfigurationPropertiesTests.java index b47ec7ded276..9e1219809dd5 100644 --- a/spring-boot/src/test/java/org/springframework/boot/context/properties/EnableConfigurationPropertiesTests.java +++ b/spring-boot/src/test/java/org/springframework/boot/context/properties/EnableConfigurationPropertiesTests.java @@ -123,7 +123,7 @@ public void testExceptionOnValidation() { 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/src/test/java/org/springframework/boot/context/properties/source/ConfigurationPropertySourcesTests.java b/spring-boot/src/test/java/org/springframework/boot/context/properties/source/ConfigurationPropertySourcesTests.java index 1f962bf0b650..1a541c9360d9 100644 --- a/spring-boot/src/test/java/org/springframework/boot/context/properties/source/ConfigurationPropertySourcesTests.java +++ b/spring-boot/src/test/java/org/springframework/boot/context/properties/source/ConfigurationPropertySourcesTests.java @@ -46,9 +46,9 @@ public void attachShouldAddAdapterAtBeginning() throws Exception { 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 void getWhenAttachedShouldReturnAttached() throws Exception { 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 void environmentPropertyExpansionShouldWorkWhenAttached() throws Exceptio 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 void fromPropertySourceShouldReturnSpringConfigurationPropertySource() 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 String getProperty(String key) { }); 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/src/test/java/org/springframework/boot/context/properties/source/SpringConfigurationPropertySourcesTests.java b/spring-boot/src/test/java/org/springframework/boot/context/properties/source/SpringConfigurationPropertySourcesTests.java index 786020ca758f..01a390133a3f 100644 --- a/spring-boot/src/test/java/org/springframework/boot/context/properties/source/SpringConfigurationPropertySourcesTests.java +++ b/spring-boot/src/test/java/org/springframework/boot/context/properties/source/SpringConfigurationPropertySourcesTests.java @@ -54,7 +54,7 @@ public void createWhenPropertySourcesIsNullShouldThrowException() throws Excepti 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 void shouldAdaptPropertySource() throws Exception { 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 void shouldAdaptSystemEnvironmentPropertySource() throws Exception { 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 void shouldAdaptMultiplePropertySources() throws Exception { 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 String getProperty(String key) { }); 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 String getProperty(String key) { 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/src/test/java/org/springframework/boot/web/client/RestTemplateBuilderTests.java b/spring-boot/src/test/java/org/springframework/boot/web/client/RestTemplateBuilderTests.java index 96dd8295966d..4d7e856569b9 100644 --- a/spring-boot/src/test/java/org/springframework/boot/web/client/RestTemplateBuilderTests.java +++ b/spring-boot/src/test/java/org/springframework/boot/web/client/RestTemplateBuilderTests.java @@ -185,7 +185,7 @@ public void additionalMessageConvertersShouldAddToExisting() throws Exception { @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 void defaultMessageConvertersShouldSetDefaultList() throws Exception { @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/src/test/java/org/springframework/boot/web/servlet/support/SpringBootServletInitializerTests.java b/spring-boot/src/test/java/org/springframework/boot/web/servlet/support/SpringBootServletInitializerTests.java index 1731555d3812..b340fa4e9718 100644 --- a/spring-boot/src/test/java/org/springframework/boot/web/servlet/support/SpringBootServletInitializerTests.java +++ b/spring-boot/src/test/java/org/springframework/boot/web/servlet/support/SpringBootServletInitializerTests.java @@ -138,7 +138,7 @@ public void servletContextPropertySourceIsAvailablePriorToRefresh() 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())