Remove explicit type arguments

See gh-10494
This commit is contained in:
Johnny Lim
2017-10-03 01:25:51 +09:00
committed by Andy Wilkinson
parent a256602c7b
commit 6168fae720
61 changed files with 105 additions and 108 deletions

View File

@@ -131,7 +131,7 @@ public abstract class AutoConfigurationPackages {
@Override
public Set<Object> determineImports(AnnotationMetadata metadata) {
return Collections.<Object>singleton(new PackageImport(metadata));
return Collections.singleton(new PackageImport(metadata));
}
}

View File

@@ -174,7 +174,7 @@ class AutoConfigurationSorter {
private Set<String> readBefore() {
if (wasProcessed()) {
return this.autoConfigurationMetadata.getSet(this.className,
"AutoConfigureBefore", Collections.<String>emptySet());
"AutoConfigureBefore", Collections.emptySet());
}
return getAnnotationValue(AutoConfigureBefore.class);
}
@@ -182,7 +182,7 @@ class AutoConfigurationSorter {
private Set<String> readAfter() {
if (wasProcessed()) {
return this.autoConfigurationMetadata.getSet(this.className,
"AutoConfigureAfter", Collections.<String>emptySet());
"AutoConfigureAfter", Collections.emptySet());
}
return getAnnotationValue(AutoConfigureAfter.class);
}

View File

@@ -61,7 +61,7 @@ class ImportAutoConfigurationImportSelector extends AutoConfigurationImportSelec
Set<String> result = new LinkedHashSet<>();
result.addAll(getCandidateConfigurations(metadata, null));
result.removeAll(getExclusions(metadata, null));
return Collections.<Object>unmodifiableSet(result);
return Collections.unmodifiableSet(result);
}
@Override

View File

@@ -42,7 +42,7 @@ public class CacheManagerCustomizers {
public CacheManagerCustomizers(
List<? extends CacheManagerCustomizer<?>> customizers) {
this.customizers = (customizers != null ? new ArrayList<>(customizers)
: Collections.<CacheManagerCustomizer<?>>emptyList());
: Collections.emptyList());
}
/**

View File

@@ -62,7 +62,7 @@ public class EntityScanner {
throws ClassNotFoundException {
List<String> packages = getPackages();
if (packages.isEmpty()) {
return Collections.<Class<?>>emptySet();
return Collections.emptySet();
}
Set<Class<?>> entitySet = new HashSet<>();
ClassPathScanningCandidateComponentProvider scanner = new ClassPathScanningCandidateComponentProvider(

View File

@@ -104,7 +104,7 @@ public class HttpMessageConverters implements Iterable<HttpMessageConverter<?>>
Collection<HttpMessageConverter<?>> converters) {
List<HttpMessageConverter<?>> combined = getCombinedConverters(converters,
addDefaultConverters ? getDefaultConverters()
: Collections.<HttpMessageConverter<?>>emptyList());
: Collections.emptyList());
combined = postProcessConverters(combined);
this.converters = Collections.unmodifiableList(combined);
}

View File

@@ -69,7 +69,7 @@ public class HttpMessageConvertersAutoConfiguration {
@ConditionalOnMissingBean
public HttpMessageConverters messageConverters() {
return new HttpMessageConverters(this.converters == null
? Collections.<HttpMessageConverter<?>>emptyList() : this.converters);
? Collections.emptyList() : this.converters);
}
@Configuration

View File

@@ -49,7 +49,7 @@ class ActiveMQConnectionFactoryFactory {
Assert.notNull(properties, "Properties must not be null");
this.properties = properties;
this.factoryCustomizers = (factoryCustomizers != null ? factoryCustomizers
: Collections.<ActiveMQConnectionFactoryCustomizer>emptyList());
: Collections.emptyList());
}
public <T extends ActiveMQConnectionFactory> T createConnectionFactory(

View File

@@ -57,7 +57,7 @@ public class LdapAutoConfiguration {
source.setBase(this.properties.getBase());
source.setUrls(this.properties.determineUrls(this.environment));
source.setBaseEnvironmentProperties(Collections
.<String, Object>unmodifiableMap(this.properties.getBaseEnvironment()));
.unmodifiableMap(this.properties.getBaseEnvironment()));
return source;
}

View File

@@ -258,7 +258,7 @@ public class EmbeddedMongoAutoConfiguration {
Set<Feature> features) {
Assert.notNull(version, "version must not be null");
this.version = version;
this.features = (features == null ? Collections.<Feature>emptySet()
this.features = (features == null ? Collections.emptySet()
: features);
}

View File

@@ -63,7 +63,7 @@ public class BasicErrorController extends AbstractErrorController {
public BasicErrorController(ErrorAttributes errorAttributes,
ErrorProperties errorProperties) {
this(errorAttributes, errorProperties,
Collections.<ErrorViewResolver>emptyList());
Collections.emptyList());
}
/**

View File

@@ -248,7 +248,7 @@ public class AutoConfigurationImportSelectorTests {
@Override
protected List<AutoConfigurationImportListener> getAutoConfigurationImportListeners() {
return Collections.<AutoConfigurationImportListener>singletonList(
return Collections.singletonList(
(event) -> this.lastEvent = event);
}

View File

@@ -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.<String>emptyList());
.willReturn(Collections.emptyList());
return cacheManager;
}

View File

@@ -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.<String>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.<String>singleton("java.io.DoesNotExist"));
.willReturn(Collections.singleton("java.io.DoesNotExist"));
return metadata;
}

View File

@@ -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.<String>emptyList());
EntityScanPackages.register(null, Collections.emptyList());
}
@Test

View File

@@ -103,7 +103,7 @@ public class HazelcastJpaDependencyAutoConfigurationTests {
.getSourceApplicationContext()).getBeanDefinition("entityManagerFactory")
.getDependsOn();
return dependsOn != null ? Arrays.asList(dependsOn)
: Collections.<String>emptyList();
: Collections.emptyList();
}
@Configuration

View File

@@ -88,7 +88,7 @@ public class ActiveMQPropertiesTests {
private ActiveMQConnectionFactoryFactory createFactory(
ActiveMQProperties properties) {
return new ActiveMQConnectionFactoryFactory(properties,
Collections.<ActiveMQConnectionFactoryCustomizer>emptyList());
Collections.emptyList());
}
}

View File

@@ -36,7 +36,7 @@ public class JndiPropertiesHidingClassLoader extends ClassLoader {
@Override
public Enumeration<URL> getResources(String name) throws IOException {
if ("jndi.properties".equals(name)) {
return Collections.enumeration(Collections.<URL>emptyList());
return Collections.enumeration(Collections.emptyList());
}
return super.getResources(name);
}

View File

@@ -89,7 +89,7 @@ public class DeviceDelegatingViewResolverAutoConfigurationTests {
@Test
public void deviceDelegatingFreeMarkerViewResolver() throws Exception {
load(Collections.<Class<?>>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.<Class<?>>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.<Class<?>>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.<Class<?>>singletonList(ThymeleafAutoConfiguration.class),
load(Collections.singletonList(ThymeleafAutoConfiguration.class),
"spring.mobile.devicedelegatingviewresolver.enabled:true");
assertThat(this.context.getBeansOfType(LiteDeviceDelegatingViewResolver.class))
.hasSize(2);