Skip to content

Commit ffed4ea

Browse files
ngocnhan-tran1996jzheaux
authored andcommitted
Polish diamond usage
1 parent 9cb81f8 commit ffed4ea

File tree

9 files changed

+16
-18
lines changed

9 files changed

+16
-18
lines changed

config/src/main/java/org/springframework/security/config/annotation/web/builders/HttpSecurity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3696,7 +3696,7 @@ public HttpSecurity securityMatcher(String... patterns) {
36963696
* @throws Exception
36973697
*/
36983698
public HttpSecurity webAuthn(Customizer<WebAuthnConfigurer<HttpSecurity>> webAuthn) throws Exception {
3699-
webAuthn.customize(getOrApply(new WebAuthnConfigurer<HttpSecurity>()));
3699+
webAuthn.customize(getOrApply(new WebAuthnConfigurer<>()));
37003700
return HttpSecurity.this;
37013701
}
37023702

config/src/main/java/org/springframework/security/config/annotation/web/configurers/HttpBasicConfigurer.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2023 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -179,8 +179,7 @@ private void registerDefaults(B http) {
179179
allMatcher.setUseEquals(true);
180180
RequestMatcher notHtmlMatcher = new NegatedRequestMatcher(
181181
new MediaTypeRequestMatcher(contentNegotiationStrategy, MediaType.TEXT_HTML));
182-
RequestMatcher restNotHtmlMatcher = new AndRequestMatcher(
183-
Arrays.<RequestMatcher>asList(notHtmlMatcher, restMatcher));
182+
RequestMatcher restNotHtmlMatcher = new AndRequestMatcher(Arrays.asList(notHtmlMatcher, restMatcher));
184183
RequestMatcher preferredMatcher = new OrRequestMatcher(
185184
Arrays.asList(X_REQUESTED_WITH, restNotHtmlMatcher, allMatcher));
186185
registerDefaultEntryPoint(http, preferredMatcher);

config/src/main/java/org/springframework/security/config/annotation/web/configurers/oauth2/server/resource/OAuth2ResourceServerConfigurer.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2023 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -326,8 +326,7 @@ private void registerDefaultEntryPoint(H http) {
326326
allMatcher.setUseEquals(true);
327327
RequestMatcher notHtmlMatcher = new NegatedRequestMatcher(
328328
new MediaTypeRequestMatcher(contentNegotiationStrategy, MediaType.TEXT_HTML));
329-
RequestMatcher restNotHtmlMatcher = new AndRequestMatcher(
330-
Arrays.<RequestMatcher>asList(notHtmlMatcher, restMatcher));
329+
RequestMatcher restNotHtmlMatcher = new AndRequestMatcher(Arrays.asList(notHtmlMatcher, restMatcher));
331330
RequestMatcher preferredMatcher = new OrRequestMatcher(
332331
Arrays.asList(this.requestMatcher, X_REQUESTED_WITH, restNotHtmlMatcher, allMatcher));
333332
exceptionHandling.defaultAuthenticationEntryPointFor(this.authenticationEntryPoint, preferredMatcher);

config/src/main/java/org/springframework/security/config/authentication/AuthenticationManagerFactoryBean.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public AuthenticationManager getObject() throws Exception {
7373
provider.setPasswordEncoder(passwordEncoder);
7474
}
7575
provider.afterPropertiesSet();
76-
ProviderManager manager = new ProviderManager(Arrays.<AuthenticationProvider>asList(provider));
76+
ProviderManager manager = new ProviderManager(Arrays.asList(provider));
7777
if (this.observationRegistry.isNoop()) {
7878
return manager;
7979
}

core/src/main/java/org/springframework/security/authentication/jaas/memory/InMemoryConfiguration.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2010-2016 the original author or authors.
2+
* Copyright 2010-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -48,7 +48,7 @@ public class InMemoryConfiguration extends Configuration {
4848
* {@link #getAppConfigurationEntry(String)}. Can be <code>null</code>.
4949
*/
5050
public InMemoryConfiguration(AppConfigurationEntry[] defaultConfiguration) {
51-
this(Collections.<String, AppConfigurationEntry[]>emptyMap(), defaultConfiguration);
51+
this(Collections.emptyMap(), defaultConfiguration);
5252
}
5353

5454
/**

core/src/main/java/org/springframework/security/core/parameters/DefaultSecurityParameterNameDiscoverer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2016 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -53,7 +53,7 @@ public class DefaultSecurityParameterNameDiscoverer extends PrioritizedParameter
5353
* instances.
5454
*/
5555
public DefaultSecurityParameterNameDiscoverer() {
56-
this(Collections.<ParameterNameDiscoverer>emptyList());
56+
this(Collections.emptyList());
5757
}
5858

5959
/**

core/src/main/java/org/springframework/security/jackson2/CoreJackson2Module.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2015-2016 the original author or authors.
2+
* Copyright 2015-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -60,11 +60,11 @@ public void setupModule(SetupContext context) {
6060
context.setMixInAnnotations(AnonymousAuthenticationToken.class, AnonymousAuthenticationTokenMixin.class);
6161
context.setMixInAnnotations(RememberMeAuthenticationToken.class, RememberMeAuthenticationTokenMixin.class);
6262
context.setMixInAnnotations(SimpleGrantedAuthority.class, SimpleGrantedAuthorityMixin.class);
63-
context.setMixInAnnotations(Collections.<Object>unmodifiableSet(Collections.emptySet()).getClass(),
63+
context.setMixInAnnotations(Collections.unmodifiableSet(Collections.emptySet()).getClass(),
6464
UnmodifiableSetMixin.class);
65-
context.setMixInAnnotations(Collections.<Object>unmodifiableList(Collections.emptyList()).getClass(),
65+
context.setMixInAnnotations(Collections.unmodifiableList(Collections.emptyList()).getClass(),
6666
UnmodifiableListMixin.class);
67-
context.setMixInAnnotations(Collections.<Object, Object>unmodifiableMap(Collections.emptyMap()).getClass(),
67+
context.setMixInAnnotations(Collections.unmodifiableMap(Collections.emptyMap()).getClass(),
6868
UnmodifiableMapMixin.class);
6969
context.setMixInAnnotations(User.class, UserMixin.class);
7070
context.setMixInAnnotations(UsernamePasswordAuthenticationToken.class,

oauth2/oauth2-client/src/main/java/org/springframework/security/oauth2/client/jackson2/JsonNodeUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ abstract class JsonNodeUtils {
3434
static final TypeReference<Set<String>> STRING_SET = new TypeReference<>() {
3535
};
3636

37-
static final TypeReference<Map<String, Object>> STRING_OBJECT_MAP = new TypeReference<Map<String, Object>>() {
37+
static final TypeReference<Map<String, Object>> STRING_OBJECT_MAP = new TypeReference<>() {
3838
};
3939

4040
static String findStringValue(JsonNode jsonNode, String fieldName) {

web/src/main/java/org/springframework/security/web/webauthn/api/PublicKeyCredential.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public AuthenticationExtensionsClientOutputs getClientExtensionResults() {
121121
* @return the {@link PublicKeyCredentialBuilder}
122122
*/
123123
public static <T extends AuthenticatorResponse> PublicKeyCredentialBuilder<T> builder() {
124-
return new PublicKeyCredentialBuilder<T>();
124+
return new PublicKeyCredentialBuilder<>();
125125
}
126126

127127
/**

0 commit comments

Comments
 (0)