Skip to content

Commit 6168fae

Browse files
izeyewilkinsona
authored andcommitted
Remove explicit type arguments
See gh-10494
1 parent a256602 commit 6168fae

File tree

61 files changed

+105
-108
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+105
-108
lines changed

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/ManagementServerFactoryCustomizer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public final void customize(T factory) {
6767
// the same place)
6868
webServerFactoryCustomizer.customize(factory);
6969
// Then reset the error pages
70-
factory.setErrorPages(Collections.<ErrorPage>emptySet());
70+
factory.setErrorPages(Collections.emptySet());
7171
// and add the management-specific bits
7272
customize(factory, managementServerProperties, serverProperties);
7373
}

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/servlet/RequestMappingEndpointTests.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
import org.springframework.context.annotation.Scope;
3939
import org.springframework.context.annotation.ScopedProxyMode;
4040
import org.springframework.context.support.StaticApplicationContext;
41-
import org.springframework.web.servlet.handler.AbstractHandlerMethodMapping;
4241
import org.springframework.web.servlet.handler.AbstractUrlHandlerMapping;
4342
import org.springframework.web.servlet.handler.SimpleUrlHandlerMapping;
4443

@@ -60,7 +59,7 @@ public void concreteUrlMappings() {
6059
mapping.setApplicationContext(new StaticApplicationContext());
6160
mapping.initApplicationContext();
6261
this.endpoint.setHandlerMappings(
63-
Collections.<AbstractUrlHandlerMapping>singletonList(mapping));
62+
Collections.singletonList(mapping));
6463
Map<String, Object> result = this.endpoint.mappings();
6564
assertThat(result).hasSize(1);
6665
@SuppressWarnings("unchecked")
@@ -121,7 +120,7 @@ public void beanMethodMappings() {
121120
public void concreteMethodMappings() {
122121
WebMvcEndpointHandlerMapping mapping = createHandlerMapping();
123122
this.endpoint.setMethodMappings(
124-
Collections.<AbstractHandlerMethodMapping<?>>singletonList(mapping));
123+
Collections.singletonList(mapping));
125124
Map<String, Object> result = this.endpoint.mappings();
126125
assertThat(result).hasSize(2);
127126
assertThat(result.keySet())

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/context/ShutdownEndpoint.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@
3939
public class ShutdownEndpoint implements ApplicationContextAware {
4040

4141
private static final Map<String, String> NO_CONTEXT_MESSAGE = Collections
42-
.unmodifiableMap(Collections.<String, String>singletonMap("message",
42+
.unmodifiableMap(Collections.singletonMap("message",
4343
"No context to shutdown."));
4444

4545
private static final Map<String, String> SHUTDOWN_MESSAGE = Collections
46-
.unmodifiableMap(Collections.<String, String>singletonMap("message",
46+
.unmodifiableMap(Collections.singletonMap("message",
4747
"Shutting down, bye..."));
4848

4949
private ConfigurableApplicationContext context;

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/context/properties/ConfigurationPropertiesReportEndpoint.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ private Map<String, Object> safeSerialize(ObjectMapper mapper, Object bean,
154154
return result;
155155
}
156156
catch (Exception ex) {
157-
return new HashMap<>(Collections.<String, Object>singletonMap("error",
157+
return new HashMap<>(Collections.singletonMap("error",
158158
"Cannot serialize '" + prefix + "'"));
159159
}
160160
}

spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/audit/AuditEventsEndpointWebIntegrationTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public AuditEventsWebEndpointExtension auditEventsWebEndpointExtension(
106106

107107
private AuditEvent createEvent(String instant, String principal, String type) {
108108
return new AuditEvent(Date.from(Instant.parse(instant)), principal, type,
109-
Collections.<String, Object>emptyMap());
109+
Collections.emptyMap());
110110
}
111111

112112
}

spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/audit/listener/AuditListenerTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public class AuditListenerTests {
3737
public void testStoredEvents() {
3838
AuditEventRepository repository = mock(AuditEventRepository.class);
3939
AuditEvent event = new AuditEvent("principal", "type",
40-
Collections.<String, Object>emptyMap());
40+
Collections.emptyMap());
4141
AuditListener listener = new AuditListener(repository);
4242
listener.onApplicationEvent(new AuditApplicationEvent(event));
4343
verify(repository).add(event);

spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/security/AuthorizationAuditListenerTests.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import org.springframework.boot.actuate.audit.listener.AuditApplicationEvent;
2626
import org.springframework.context.ApplicationEventPublisher;
2727
import org.springframework.security.access.AccessDeniedException;
28-
import org.springframework.security.access.ConfigAttribute;
2928
import org.springframework.security.access.SecurityConfig;
3029
import org.springframework.security.access.event.AbstractAuthorizationEvent;
3130
import org.springframework.security.access.event.AuthenticationCredentialsNotFoundEvent;
@@ -56,7 +55,7 @@ public void init() {
5655
public void testAuthenticationCredentialsNotFound() {
5756
AuditApplicationEvent event = handleAuthorizationEvent(
5857
new AuthenticationCredentialsNotFoundEvent(this,
59-
Collections.<ConfigAttribute>singletonList(
58+
Collections.singletonList(
6059
new SecurityConfig("USER")),
6160
new AuthenticationCredentialsNotFoundException("Bad user")));
6261
assertThat(event.getAuditEvent().getType())
@@ -67,7 +66,7 @@ public void testAuthenticationCredentialsNotFound() {
6766
public void testAuthorizationFailure() {
6867
AuditApplicationEvent event = handleAuthorizationEvent(
6968
new AuthorizationFailureEvent(this,
70-
Collections.<ConfigAttribute>singletonList(
69+
Collections.singletonList(
7170
new SecurityConfig("USER")),
7271
new UsernamePasswordAuthenticationToken("user", "password"),
7372
new AccessDeniedException("Bad user")));
@@ -83,7 +82,7 @@ public void testDetailsAreIncludedInAuditEvent() throws Exception {
8382
authentication.setDetails(details);
8483
AuditApplicationEvent event = handleAuthorizationEvent(
8584
new AuthorizationFailureEvent(this,
86-
Collections.<ConfigAttribute>singletonList(
85+
Collections.singletonList(
8786
new SecurityConfig("USER")),
8887
authentication, new AccessDeniedException("Bad user")));
8988
assertThat(event.getAuditEvent().getType())

spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/trace/InMemoryTraceRepositoryTests.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ public class InMemoryTraceRepositoryTests {
3535
@Test
3636
public void capacityLimited() {
3737
this.repository.setCapacity(2);
38-
this.repository.add(Collections.<String, Object>singletonMap("foo", "bar"));
39-
this.repository.add(Collections.<String, Object>singletonMap("bar", "foo"));
40-
this.repository.add(Collections.<String, Object>singletonMap("bar", "bar"));
38+
this.repository.add(Collections.singletonMap("foo", "bar"));
39+
this.repository.add(Collections.singletonMap("bar", "foo"));
40+
this.repository.add(Collections.singletonMap("bar", "bar"));
4141
List<Trace> traces = this.repository.findAll();
4242
assertThat(traces).hasSize(2);
4343
assertThat(traces.get(0).getInfo().get("bar")).isEqualTo("bar");
@@ -48,9 +48,9 @@ public void capacityLimited() {
4848
public void reverseFalse() {
4949
this.repository.setReverse(false);
5050
this.repository.setCapacity(2);
51-
this.repository.add(Collections.<String, Object>singletonMap("foo", "bar"));
52-
this.repository.add(Collections.<String, Object>singletonMap("bar", "foo"));
53-
this.repository.add(Collections.<String, Object>singletonMap("bar", "bar"));
51+
this.repository.add(Collections.singletonMap("foo", "bar"));
52+
this.repository.add(Collections.singletonMap("bar", "foo"));
53+
this.repository.add(Collections.singletonMap("bar", "bar"));
5454
List<Trace> traces = this.repository.findAll();
5555
assertThat(traces).hasSize(2);
5656
assertThat(traces.get(1).getInfo().get("bar")).isEqualTo("bar");

spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/trace/TraceEndpointTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public class TraceEndpointTests {
3333
@Test
3434
public void trace() throws Exception {
3535
TraceRepository repository = new InMemoryTraceRepository();
36-
repository.add(Collections.<String, Object>singletonMap("a", "b"));
36+
repository.add(Collections.singletonMap("a", "b"));
3737
Trace trace = new TraceEndpoint(repository).traces().getTraces().get(0);
3838
assertThat(trace.getInfo().get("a")).isEqualTo("b");
3939
}

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigurationPackages.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public void registerBeanDefinitions(AnnotationMetadata metadata,
131131

132132
@Override
133133
public Set<Object> determineImports(AnnotationMetadata metadata) {
134-
return Collections.<Object>singleton(new PackageImport(metadata));
134+
return Collections.singleton(new PackageImport(metadata));
135135
}
136136

137137
}

0 commit comments

Comments
 (0)