Skip to content

Commit 2b426c3

Browse files
committed
Polish “Remove explicit type arguments”
Closes gh-10494
1 parent 6168fae commit 2b426c3

File tree

25 files changed

+65
-86
lines changed

25 files changed

+65
-86
lines changed

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,7 @@ public void concreteUrlMappings() {
5858
mapping.setUrlMap(Collections.singletonMap("/foo", new Object()));
5959
mapping.setApplicationContext(new StaticApplicationContext());
6060
mapping.initApplicationContext();
61-
this.endpoint.setHandlerMappings(
62-
Collections.singletonList(mapping));
61+
this.endpoint.setHandlerMappings(Collections.singletonList(mapping));
6362
Map<String, Object> result = this.endpoint.mappings();
6463
assertThat(result).hasSize(1);
6564
@SuppressWarnings("unchecked")
@@ -119,8 +118,7 @@ public void beanMethodMappings() {
119118
@Test
120119
public void concreteMethodMappings() {
121120
WebMvcEndpointHandlerMapping mapping = createHandlerMapping();
122-
this.endpoint.setMethodMappings(
123-
Collections.singletonList(mapping));
121+
this.endpoint.setMethodMappings(Collections.singletonList(mapping));
124122
Map<String, Object> result = this.endpoint.mappings();
125123
assertThat(result).hasSize(2);
126124
assertThat(result.keySet())

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

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

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

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

4949
private ConfigurableApplicationContext context;
5050

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ public class AuditListenerTests {
3636
@Test
3737
public void testStoredEvents() {
3838
AuditEventRepository repository = mock(AuditEventRepository.class);
39-
AuditEvent event = new AuditEvent("principal", "type",
40-
Collections.emptyMap());
39+
AuditEvent event = new AuditEvent("principal", "type", Collections.emptyMap());
4140
AuditListener listener = new AuditListener(repository);
4241
listener.onApplicationEvent(new AuditApplicationEvent(event));
4342
verify(repository).add(event);

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

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,7 @@ public void init() {
5555
public void testAuthenticationCredentialsNotFound() {
5656
AuditApplicationEvent event = handleAuthorizationEvent(
5757
new AuthenticationCredentialsNotFoundEvent(this,
58-
Collections.singletonList(
59-
new SecurityConfig("USER")),
58+
Collections.singletonList(new SecurityConfig("USER")),
6059
new AuthenticationCredentialsNotFoundException("Bad user")));
6160
assertThat(event.getAuditEvent().getType())
6261
.isEqualTo(AuthenticationAuditListener.AUTHENTICATION_FAILURE);
@@ -66,8 +65,7 @@ public void testAuthenticationCredentialsNotFound() {
6665
public void testAuthorizationFailure() {
6766
AuditApplicationEvent event = handleAuthorizationEvent(
6867
new AuthorizationFailureEvent(this,
69-
Collections.singletonList(
70-
new SecurityConfig("USER")),
68+
Collections.singletonList(new SecurityConfig("USER")),
7169
new UsernamePasswordAuthenticationToken("user", "password"),
7270
new AccessDeniedException("Bad user")));
7371
assertThat(event.getAuditEvent().getType())
@@ -82,8 +80,7 @@ public void testDetailsAreIncludedInAuditEvent() throws Exception {
8280
authentication.setDetails(details);
8381
AuditApplicationEvent event = handleAuthorizationEvent(
8482
new AuthorizationFailureEvent(this,
85-
Collections.singletonList(
86-
new SecurityConfig("USER")),
83+
Collections.singletonList(new SecurityConfig("USER")),
8784
authentication, new AccessDeniedException("Bad user")));
8885
assertThat(event.getAuditEvent().getType())
8986
.isEqualTo(AuthorizationAuditListener.AUTHORIZATION_FAILURE);

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,7 @@ public HttpMessageConverters(
103103
public HttpMessageConverters(boolean addDefaultConverters,
104104
Collection<HttpMessageConverter<?>> converters) {
105105
List<HttpMessageConverter<?>> combined = getCombinedConverters(converters,
106-
addDefaultConverters ? getDefaultConverters()
107-
: Collections.emptyList());
106+
addDefaultConverters ? getDefaultConverters() : Collections.emptyList());
108107
combined = postProcessConverters(combined);
109108
this.converters = Collections.unmodifiableList(combined);
110109
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ public HttpMessageConvertersAutoConfiguration(
6868
@Bean
6969
@ConditionalOnMissingBean
7070
public HttpMessageConverters messageConverters() {
71-
return new HttpMessageConverters(this.converters == null
72-
? Collections.emptyList() : this.converters);
71+
return new HttpMessageConverters(
72+
this.converters == null ? Collections.emptyList() : this.converters);
7373
}
7474

7575
@Configuration

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ public ContextSource ldapContextSource() {
5656
source.setPassword(this.properties.getPassword());
5757
source.setBase(this.properties.getBase());
5858
source.setUrls(this.properties.determineUrls(this.environment));
59-
source.setBaseEnvironmentProperties(Collections
60-
.unmodifiableMap(this.properties.getBaseEnvironment()));
59+
source.setBaseEnvironmentProperties(
60+
Collections.unmodifiableMap(this.properties.getBaseEnvironment()));
6161
return source;
6262
}
6363

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mongo/embedded/EmbeddedMongoAutoConfiguration.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,7 @@ private ToStringFriendlyFeatureAwareVersion(String version,
258258
Set<Feature> features) {
259259
Assert.notNull(version, "version must not be null");
260260
this.version = version;
261-
this.features = (features == null ? Collections.emptySet()
262-
: features);
261+
this.features = (features == null ? Collections.emptySet() : features);
263262
}
264263

265264
@Override

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/error/BasicErrorController.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,7 @@ public class BasicErrorController extends AbstractErrorController {
6262
*/
6363
public BasicErrorController(ErrorAttributes errorAttributes,
6464
ErrorProperties errorProperties) {
65-
this(errorAttributes, errorProperties,
66-
Collections.emptyList());
65+
this(errorAttributes, errorProperties, Collections.emptyList());
6766
}
6867

6968
/**

spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/AutoConfigurationImportSelectorTests.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,7 @@ protected List<AutoConfigurationImportFilter> getAutoConfigurationImportFilters(
248248

249249
@Override
250250
protected List<AutoConfigurationImportListener> getAutoConfigurationImportListeners() {
251-
return Collections.singletonList(
252-
(event) -> this.lastEvent = event);
251+
return Collections.singletonList((event) -> this.lastEvent = event);
253252
}
254253

255254
public AutoConfigurationImportEvent getLastEvent() {

0 commit comments

Comments
 (0)