Skip to content

Commit 31f8cae

Browse files
ngocnhan-tran1996jzheaux
authored andcommitted
Polish diamond operator usage
1 parent f3e95c8 commit 31f8cae

File tree

24 files changed

+42
-44
lines changed

24 files changed

+42
-44
lines changed

buildSrc/src/main/java/org/springframework/security/convention/versions/VerifyDependenciesVersionsPlugin.java

Lines changed: 1 addition & 1 deletion
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.

config/src/main/java/org/springframework/security/config/annotation/authentication/configuration/InitializeAuthenticationProviderBeanManagerConfigurer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2019 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.
@@ -95,7 +95,7 @@ private <T> List<BeanWithName<T>> getBeansWithName(Class<T> type) {
9595
.getBeanNamesForType(type);
9696
for (String beanName : beanNames) {
9797
T bean = InitializeAuthenticationProviderBeanManagerConfigurer.this.context.getBean(beanName, type);
98-
beanWithNames.add(new BeanWithName<T>(bean, beanName));
98+
beanWithNames.add(new BeanWithName<>(bean, beanName));
9999
}
100100
return beanWithNames;
101101
}

config/src/main/java/org/springframework/security/config/annotation/authentication/configuration/InitializeUserDetailsBeanManagerConfigurer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ private <T> List<BeanWithName<T>> getBeansWithName(Class<T> type) {
134134
String[] beanNames = InitializeUserDetailsBeanManagerConfigurer.this.context.getBeanNamesForType(type);
135135
for (String beanName : beanNames) {
136136
T bean = InitializeUserDetailsBeanManagerConfigurer.this.context.getBean(beanName, type);
137-
beanWithNames.add(new BeanWithName<T>(bean, beanName));
137+
beanWithNames.add(new BeanWithName<>(bean, beanName));
138138
}
139139
return beanWithNames;
140140
}

config/src/main/java/org/springframework/security/config/annotation/method/configuration/GlobalMethodSecurityConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public class GlobalMethodSecurityConfiguration implements ImportAware, SmartInit
9797

9898
private static final Log logger = LogFactory.getLog(GlobalMethodSecurityConfiguration.class);
9999

100-
private ObjectPostProcessor<Object> objectPostProcessor = new ObjectPostProcessor<Object>() {
100+
private ObjectPostProcessor<Object> objectPostProcessor = new ObjectPostProcessor<>() {
101101

102102
@Override
103103
public <T> T postProcess(T object) {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2015-2018 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.
@@ -42,7 +42,7 @@
4242
*/
4343
class UserDeserializer extends JsonDeserializer<User> {
4444

45-
private static final TypeReference<Set<SimpleGrantedAuthority>> SIMPLE_GRANTED_AUTHORITY_SET = new TypeReference<Set<SimpleGrantedAuthority>>() {
45+
private static final TypeReference<Set<SimpleGrantedAuthority>> SIMPLE_GRANTED_AUTHORITY_SET = new TypeReference<>() {
4646
};
4747

4848
/**

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2015-2022 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.
@@ -50,10 +50,10 @@
5050
*/
5151
class UsernamePasswordAuthenticationTokenDeserializer extends JsonDeserializer<UsernamePasswordAuthenticationToken> {
5252

53-
private static final TypeReference<List<GrantedAuthority>> GRANTED_AUTHORITY_LIST = new TypeReference<List<GrantedAuthority>>() {
53+
private static final TypeReference<List<GrantedAuthority>> GRANTED_AUTHORITY_LIST = new TypeReference<>() {
5454
};
5555

56-
private static final TypeReference<Object> OBJECT = new TypeReference<Object>() {
56+
private static final TypeReference<Object> OBJECT = new TypeReference<>() {
5757
};
5858

5959
/**

messaging/src/main/java/org/springframework/security/messaging/util/matcher/MessageMatcher.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.
@@ -29,7 +29,7 @@ public interface MessageMatcher<T> {
2929
/**
3030
* Matches every {@link Message}
3131
*/
32-
MessageMatcher<Object> ANY_MESSAGE = new MessageMatcher<Object>() {
32+
MessageMatcher<Object> ANY_MESSAGE = new MessageMatcher<>() {
3333

3434
@Override
3535
public boolean matches(Message<?> message) {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2020 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.
@@ -31,7 +31,7 @@
3131
*/
3232
abstract class JsonNodeUtils {
3333

34-
static final TypeReference<Set<String>> STRING_SET = new TypeReference<Set<String>>() {
34+
static final TypeReference<Set<String>> STRING_SET = new TypeReference<>() {
3535
};
3636

3737
static final TypeReference<Map<String, Object>> STRING_OBJECT_MAP = new TypeReference<Map<String, Object>>() {

oauth2/oauth2-client/src/main/java/org/springframework/security/oauth2/client/oidc/authentication/ReactiveOidcIdTokenDecoderFactory.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2019 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.
@@ -70,7 +70,7 @@ public final class ReactiveOidcIdTokenDecoderFactory implements ReactiveJwtDecod
7070

7171
private static final Map<JwsAlgorithm, String> JCA_ALGORITHM_MAPPINGS;
7272
static {
73-
Map<JwsAlgorithm, String> mappings = new HashMap<JwsAlgorithm, String>();
73+
Map<JwsAlgorithm, String> mappings = new HashMap<>();
7474
mappings.put(MacAlgorithm.HS256, "HmacSHA256");
7575
mappings.put(MacAlgorithm.HS384, "HmacSHA384");
7676
mappings.put(MacAlgorithm.HS512, "HmacSHA512");

oauth2/oauth2-client/src/main/java/org/springframework/security/oauth2/client/registration/ClientRegistrations.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2021 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.
@@ -66,7 +66,7 @@ public final class ClientRegistrations {
6666
rest.setRequestFactory(requestFactory);
6767
}
6868

69-
private static final ParameterizedTypeReference<Map<String, Object>> typeReference = new ParameterizedTypeReference<Map<String, Object>>() {
69+
private static final ParameterizedTypeReference<Map<String, Object>> typeReference = new ParameterizedTypeReference<>() {
7070
};
7171

7272
private ClientRegistrations() {

0 commit comments

Comments
 (0)