Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public final void customize(T factory) {
// the same place)
webServerFactoryCustomizer.customize(factory);
// Then reset the error pages
factory.setErrorPages(Collections.<ErrorPage>emptySet());
factory.setErrorPages(Collections.emptySet());
// and add the management-specific bits
customize(factory, managementServerProperties, serverProperties);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -58,7 +57,7 @@ public void concreteUrlMappings() {
mapping.setApplicationContext(new StaticApplicationContext());
mapping.initApplicationContext();
this.endpoint.setHandlerMappings(
Collections.<AbstractUrlHandlerMapping>singletonList(mapping));
Collections.singletonList(mapping));
Map<String, Object> result = this.endpoint.mappings();
assertThat(result).hasSize(1);
@SuppressWarnings("unchecked")
Expand Down Expand Up @@ -119,7 +118,7 @@ public void beanMethodMappings() {
public void concreteMethodMappings() {
WebMvcEndpointHandlerMapping mapping = createHandlerMapping();
this.endpoint.setMethodMappings(
Collections.<AbstractHandlerMethodMapping<?>>singletonList(mapping));
Collections.singletonList(mapping));
Map<String, Object> result = this.endpoint.mappings();
assertThat(result).hasSize(2);
assertThat(result.keySet())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@
public class ShutdownEndpoint implements ApplicationContextAware {

private static final Map<String, String> NO_CONTEXT_MESSAGE = Collections
.unmodifiableMap(Collections.<String, String>singletonMap("message",
.unmodifiableMap(Collections.singletonMap("message",
"No context to shutdown."));

private static final Map<String, String> SHUTDOWN_MESSAGE = Collections
.unmodifiableMap(Collections.<String, String>singletonMap("message",
.unmodifiableMap(Collections.singletonMap("message",
"Shutting down, bye..."));

private ConfigurableApplicationContext context;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ private Map<String, Object> safeSerialize(ObjectMapper mapper, Object bean,
return result;
}
catch (Exception ex) {
return new HashMap<>(Collections.<String, Object>singletonMap("error",
return new HashMap<>(Collections.singletonMap("error",
"Cannot serialize '" + prefix + "'"));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.<String, Object>emptyMap());
Collections.emptyMap());
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class AuditListenerTests {
public void testStoredEvents() {
AuditEventRepository repository = mock(AuditEventRepository.class);
AuditEvent event = new AuditEvent("principal", "type",
Collections.<String, Object>emptyMap());
Collections.emptyMap());
AuditListener listener = new AuditListener(repository);
listener.onApplicationEvent(new AuditApplicationEvent(event));
verify(repository).add(event);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -56,7 +55,7 @@ public void init() {
public void testAuthenticationCredentialsNotFound() {
AuditApplicationEvent event = handleAuthorizationEvent(
new AuthenticationCredentialsNotFoundEvent(this,
Collections.<ConfigAttribute>singletonList(
Collections.singletonList(
new SecurityConfig("USER")),
new AuthenticationCredentialsNotFoundException("Bad user")));
assertThat(event.getAuditEvent().getType())
Expand All @@ -67,7 +66,7 @@ public void testAuthenticationCredentialsNotFound() {
public void testAuthorizationFailure() {
AuditApplicationEvent event = handleAuthorizationEvent(
new AuthorizationFailureEvent(this,
Collections.<ConfigAttribute>singletonList(
Collections.singletonList(
new SecurityConfig("USER")),
new UsernamePasswordAuthenticationToken("user", "password"),
new AccessDeniedException("Bad user")));
Expand All @@ -83,7 +82,7 @@ public void testDetailsAreIncludedInAuditEvent() throws Exception {
authentication.setDetails(details);
AuditApplicationEvent event = handleAuthorizationEvent(
new AuthorizationFailureEvent(this,
Collections.<ConfigAttribute>singletonList(
Collections.singletonList(
new SecurityConfig("USER")),
authentication, new AccessDeniedException("Bad user")));
assertThat(event.getAuditEvent().getType())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ public class InMemoryTraceRepositoryTests {
@Test
public void capacityLimited() {
this.repository.setCapacity(2);
this.repository.add(Collections.<String, Object>singletonMap("foo", "bar"));
this.repository.add(Collections.<String, Object>singletonMap("bar", "foo"));
this.repository.add(Collections.<String, Object>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<Trace> traces = this.repository.findAll();
assertThat(traces).hasSize(2);
assertThat(traces.get(0).getInfo().get("bar")).isEqualTo("bar");
Expand All @@ -48,9 +48,9 @@ public void capacityLimited() {
public void reverseFalse() {
this.repository.setReverse(false);
this.repository.setCapacity(2);
this.repository.add(Collections.<String, Object>singletonMap("foo", "bar"));
this.repository.add(Collections.<String, Object>singletonMap("bar", "foo"));
this.repository.add(Collections.<String, Object>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<Trace> traces = this.repository.findAll();
assertThat(traces).hasSize(2);
assertThat(traces.get(1).getInfo().get("bar")).isEqualTo("bar");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class TraceEndpointTests {
@Test
public void trace() throws Exception {
TraceRepository repository = new InMemoryTraceRepository();
repository.add(Collections.<String, Object>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");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public void registerBeanDefinitions(AnnotationMetadata metadata,

@Override
public Set<Object> determineImports(AnnotationMetadata metadata) {
return Collections.<Object>singleton(new PackageImport(metadata));
return Collections.singleton(new PackageImport(metadata));
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,15 +174,15 @@ private int getOrder() {
private Set<String> readBefore() {
if (wasProcessed()) {
return this.autoConfigurationMetadata.getSet(this.className,
"AutoConfigureBefore", Collections.<String>emptySet());
"AutoConfigureBefore", Collections.emptySet());
}
return getAnnotationValue(AutoConfigureBefore.class);
}

private Set<String> readAfter() {
if (wasProcessed()) {
return this.autoConfigurationMetadata.getSet(this.className,
"AutoConfigureAfter", Collections.<String>emptySet());
"AutoConfigureAfter", Collections.emptySet());
}
return getAnnotationValue(AutoConfigureAfter.class);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public Set<Object> determineImports(AnnotationMetadata metadata) {
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public final Set<Class<?>> scan(Class<? extends Annotation>... annotationTypes)
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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public HttpMessageConverters(boolean addDefaultConverters,
Collection<HttpMessageConverter<?>> converters) {
List<HttpMessageConverter<?>> combined = getCombinedConverters(converters,
addDefaultConverters ? getDefaultConverters()
: Collections.<HttpMessageConverter<?>>emptyList());
: Collections.emptyList());
combined = postProcessConverters(combined);
this.converters = Collections.unmodifiableList(combined);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public HttpMessageConvertersAutoConfiguration(
@ConditionalOnMissingBean
public HttpMessageConverters messageConverters() {
return new HttpMessageConverters(this.converters == null
? Collections.<HttpMessageConverter<?>>emptyList() : this.converters);
? Collections.emptyList() : this.converters);
}

@Configuration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public ContextSource ldapContextSource() {
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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ private ToStringFriendlyFeatureAwareVersion(String version,
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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public class BasicErrorController extends AbstractErrorController {
public BasicErrorController(ErrorAttributes errorAttributes,
ErrorProperties errorProperties) {
this(errorAttributes, errorProperties,
Collections.<ErrorViewResolver>emptyList());
Collections.emptyList());
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ protected List<AutoConfigurationImportFilter> getAutoConfigurationImportFilters(

@Override
protected List<AutoConfigurationImportListener> getAutoConfigurationImportListeners() {
return Collections.<AutoConfigurationImportListener>singletonList(
return Collections.singletonList(
(event) -> this.lastEvent = event);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.<String>emptyList());
.willReturn(Collections.emptyList());
return cacheManager;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.<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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.<String>emptyList());
EntityScanPackages.register(null, Collections.emptyList());
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ private List<String> entityManagerFactoryDependencies(
.getSourceApplicationContext()).getBeanDefinition("entityManagerFactory")
.getDependsOn();
return dependsOn != null ? Arrays.asList(dependsOn)
: Collections.<String>emptyList();
: Collections.emptyList();
}

@Configuration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public void setTrustedPackages() {
private ActiveMQConnectionFactoryFactory createFactory(
ActiveMQProperties properties) {
return new ActiveMQConnectionFactoryFactory(properties,
Collections.<ActiveMQConnectionFactoryCustomizer>emptyList());
Collections.emptyList());
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public JndiPropertiesHidingClassLoader(ClassLoader parent) {
@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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public void deviceDelegatingJspResourceViewResolver() throws Exception {

@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);
Expand All @@ -100,7 +100,7 @@ public void deviceDelegatingFreeMarkerViewResolver() throws Exception {

@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);
Expand All @@ -111,7 +111,7 @@ public void deviceDelegatingGroovyMarkupViewResolver() throws Exception {

@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);
Expand All @@ -122,7 +122,7 @@ public void deviceDelegatingMustacheViewResolver() throws Exception {

@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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
*/
public class DefaultCommandFactory implements CommandFactory {

private static final List<Command> defaultCommands = Arrays.<Command>asList(
private static final List<Command> defaultCommands = Arrays.asList(
new VersionCommand(), new RunCommand(), new GrabCommand(), new JarCommand(),
new WarCommand(), new InstallCommand(), new UninstallCommand(),
new InitCommand());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.<Exclusion>emptyList());
this(groupId, artifactId, version, Collections.emptyList());
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public abstract class GroovyTemplate {

public static String template(String name)
throws IOException, CompilationFailedException, ClassNotFoundException {
return template(name, Collections.<String, Object>emptyMap());
return template(name, Collections.emptyMap());
}

public static String template(String name, Map<String, ?> model)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class CustomCommandFactory implements CommandFactory {

@Override
public Collection<Command> getCommands() {
return Collections.<Command>singleton(new CustomCommand());
return Collections.singleton(new CustomCommand());
}

}
Loading