Apply Diamond Operator

Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
This commit is contained in:
Tran Ngoc Nhan 2025-06-19 04:24:28 +07:00 committed by Josh Cummings
parent bd98db4fe8
commit d6e378e9bb
6 changed files with 7 additions and 7 deletions

View File

@ -117,7 +117,7 @@ public final class OidcBackChannelLogoutHandler implements LogoutHandler {
}
headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
String logout = computeLogoutEndpoint(request, token);
MultiValueMap<String, String> body = new LinkedMultiValueMap();
MultiValueMap<String, String> body = new LinkedMultiValueMap<>();
body.add("logout_token", token.getPrincipal().getTokenValue());
body.add("_spring_security_internal_logout", "true");
HttpEntity<?> entity = new HttpEntity<>(body, headers);

View File

@ -64,7 +64,7 @@ public class FilterChainMapBeanDefinitionDecorator implements BeanDefinitionDeco
}
BeanDefinition matcher = matcherType.createMatcher(parserContext, path, null);
if (filters.equals(HttpSecurityBeanDefinitionParser.OPT_FILTERS_NONE)) {
securityFilterChains.add(createSecurityFilterChain(matcher, new ManagedList(0)));
securityFilterChains.add(createSecurityFilterChain(matcher, new ManagedList<>(0)));
}
else {
String[] filterBeanNames = StringUtils.tokenizeToStringArray(filters, ",");

View File

@ -370,7 +370,7 @@ public class HttpSecurityBeanDefinitionParser implements BeanDefinitionParser {
// Not already registered, so register the list of filter chains and the
// FilterChainProxy
BeanDefinition listFactoryBean = new RootBeanDefinition(ListFactoryBean.class);
listFactoryBean.getPropertyValues().add("sourceList", new ManagedList());
listFactoryBean.getPropertyValues().add("sourceList", new ManagedList<>());
pc.registerBeanComponent(new BeanComponentDefinition(listFactoryBean, BeanIds.FILTER_CHAINS));
BeanDefinitionBuilder fcpBldr = BeanDefinitionBuilder.rootBeanDefinition(FilterChainProxy.class);
fcpBldr.getRawBeanDefinition().setSource(source);

View File

@ -354,7 +354,7 @@ public final class WebSocketMessageBrokerSecurityBeanDefinitionParser implements
if (!registry.containsBeanDefinition(CLIENT_INBOUND_CHANNEL_BEAN_ID)) {
return;
}
ManagedList<Object> interceptors = new ManagedList();
ManagedList<Object> interceptors = new ManagedList<>();
interceptors.add(new RootBeanDefinition(SecurityContextChannelInterceptor.class));
if (!this.sameOriginDisabled) {
if (!registry.containsBeanDefinition(CSRF_CHANNEL_INTERCEPTOR_BEAN_ID)) {

View File

@ -91,8 +91,8 @@ class SpringSecurityCoreVersionSerializableTests {
Object deserialized = objectInputStream.readObject();
// Ignore transient fields Event classes extend from EventObject which has
// transient source property
Set<String> transientFieldNames = new HashSet();
Set<Class<?>> visitedClasses = new HashSet();
Set<String> transientFieldNames = new HashSet<>();
Set<Class<?>> visitedClasses = new HashSet<>();
collectTransientFieldNames(transientFieldNames, visitedClasses, clazz);
assertThat(deserialized).usingRecursiveComparison()
.ignoringFields(transientFieldNames.toArray(new String[0]))

View File

@ -152,7 +152,7 @@ public class HttpHeadersConfigTests {
@Test
public void requestWhenFrameOptionsConfiguredThenIncludesHeader() throws Exception {
Map<String, String> headers = new HashMap(defaultHeaders);
Map<String, String> headers = new HashMap<>(defaultHeaders);
headers.put("X-Frame-Options", "SAMEORIGIN");
this.spring.configLocations(this.xml("WithFrameOptions")).autowire();
// @formatter:off