Cleanup explicit type arguments

This commit is contained in:
Lars Grefer
2019-07-04 19:08:54 +02:00
committed by Rob Winch
parent c5b5cc507c
commit 3ea9d376b2
50 changed files with 68 additions and 68 deletions

View File

@@ -53,7 +53,7 @@ public class DelegatingAccessDeniedHandlerTests {
@Before
public void setup() {
handlers = new LinkedHashMap<Class<? extends AccessDeniedException>, AccessDeniedHandler>();
handlers = new LinkedHashMap<>();
}
@Test

View File

@@ -35,7 +35,7 @@ public class ExpressionBasedFilterInvocationSecurityMetadataSourceTests {
@Test
public void expectedAttributeIsReturned() {
final String expression = "hasRole('X')";
LinkedHashMap<RequestMatcher, Collection<ConfigAttribute>> requestMap = new LinkedHashMap<RequestMatcher, Collection<ConfigAttribute>>();
LinkedHashMap<RequestMatcher, Collection<ConfigAttribute>> requestMap = new LinkedHashMap<>();
requestMap.put(AnyRequestMatcher.INSTANCE, SecurityConfig.createList(expression));
ExpressionBasedFilterInvocationSecurityMetadataSource mds = new ExpressionBasedFilterInvocationSecurityMetadataSource(
requestMap, new DefaultWebSecurityExpressionHandler());
@@ -52,7 +52,7 @@ public class ExpressionBasedFilterInvocationSecurityMetadataSourceTests {
@Test(expected = IllegalArgumentException.class)
public void invalidExpressionIsRejected() throws Exception {
LinkedHashMap<RequestMatcher, Collection<ConfigAttribute>> requestMap = new LinkedHashMap<RequestMatcher, Collection<ConfigAttribute>>();
LinkedHashMap<RequestMatcher, Collection<ConfigAttribute>> requestMap = new LinkedHashMap<>();
requestMap.put(AnyRequestMatcher.INSTANCE,
SecurityConfig.createList("hasRole('X'"));
ExpressionBasedFilterInvocationSecurityMetadataSource mds = new ExpressionBasedFilterInvocationSecurityMetadataSource(

View File

@@ -46,7 +46,7 @@ public class DefaultFilterInvocationSecurityMetadataSourceTests {
// ~ Methods
// ========================================================================================================
private void createFids(String pattern, String method) {
LinkedHashMap<RequestMatcher, Collection<ConfigAttribute>> requestMap = new LinkedHashMap<RequestMatcher, Collection<ConfigAttribute>>();
LinkedHashMap<RequestMatcher, Collection<ConfigAttribute>> requestMap = new LinkedHashMap<>();
requestMap.put(new AntPathRequestMatcher(pattern, method), this.def);
this.fids = new DefaultFilterInvocationSecurityMetadataSource(requestMap);
}
@@ -134,7 +134,7 @@ public class DefaultFilterInvocationSecurityMetadataSourceTests {
// SEC-1236
@Test
public void mixingPatternsWithAndWithoutHttpMethodsIsSupported() throws Exception {
LinkedHashMap<RequestMatcher, Collection<ConfigAttribute>> requestMap = new LinkedHashMap<RequestMatcher, Collection<ConfigAttribute>>();
LinkedHashMap<RequestMatcher, Collection<ConfigAttribute>> requestMap = new LinkedHashMap<>();
Collection<ConfigAttribute> userAttrs = SecurityConfig.createList("A");
requestMap.put(new AntPathRequestMatcher("/user/**", null), userAttrs);

View File

@@ -69,7 +69,7 @@ public class DelegatingAuthenticationFailureHandlerTests {
@Before
public void setup() {
handlers = new LinkedHashMap<Class<? extends AuthenticationException>, AuthenticationFailureHandler>();
handlers = new LinkedHashMap<>();
}
@Test

View File

@@ -154,7 +154,7 @@ public class J2eeBasedPreAuthenticatedWebAuthenticationDetailsSourceTests {
private MappableAttributesRetriever getMappableRolesRetriever(String[] mappedRoles) {
SimpleMappableAttributesRetriever result = new SimpleMappableAttributesRetriever();
result.setMappableAttributes(new HashSet<String>(Arrays.asList(mappedRoles)));
result.setMappableAttributes(new HashSet<>(Arrays.asList(mappedRoles)));
return result;
}

View File

@@ -124,7 +124,7 @@ public class CsrfRequestDataValueProcessorTests {
public void createGetExtraHiddenFieldsHasCsrfToken() {
CsrfToken token = new DefaultCsrfToken("1", "a", "b");
this.exchange.getAttributes().put(DEFAULT_CSRF_ATTR_NAME, token);
Map<String, String> expected = new HashMap<String, String>();
Map<String, String> expected = new HashMap<>();
expected.put(token.getParameterName(), token.getToken());
CsrfRequestDataValueProcessor processor = new CsrfRequestDataValueProcessor();