Cleanup explicit type arguments
This commit is contained in:
+1
-1
@@ -60,7 +60,7 @@ public final class ExpressionBasedFilterInvocationSecurityMetadataSource
|
||||
ExpressionParser parser) {
|
||||
Assert.notNull(parser, "SecurityExpressionHandler returned a null parser object");
|
||||
|
||||
LinkedHashMap<RequestMatcher, Collection<ConfigAttribute>> requestToExpressionAttributesMap = new LinkedHashMap<RequestMatcher, Collection<ConfigAttribute>>(
|
||||
LinkedHashMap<RequestMatcher, Collection<ConfigAttribute>> requestToExpressionAttributesMap = new LinkedHashMap<>(
|
||||
requestMap);
|
||||
|
||||
for (Map.Entry<RequestMatcher, Collection<ConfigAttribute>> entry : requestMap
|
||||
|
||||
@@ -92,9 +92,9 @@ public class StrictHttpFirewall implements HttpFirewall {
|
||||
|
||||
private static final List<String> FORBIDDEN_BACKSLASH = Collections.unmodifiableList(Arrays.asList("\\", "%5c", "%5C"));
|
||||
|
||||
private Set<String> encodedUrlBlacklist = new HashSet<String>();
|
||||
private Set<String> encodedUrlBlacklist = new HashSet<>();
|
||||
|
||||
private Set<String> decodedUrlBlacklist = new HashSet<String>();
|
||||
private Set<String> decodedUrlBlacklist = new HashSet<>();
|
||||
|
||||
private Set<String> allowedHttpMethods = createDefaultAllowedHttpMethods();
|
||||
|
||||
|
||||
+1
-1
@@ -266,7 +266,7 @@ public class DefaultSavedRequest implements SavedRequest {
|
||||
|
||||
@Override
|
||||
public List<Cookie> getCookies() {
|
||||
List<Cookie> cookieList = new ArrayList<Cookie>(cookies.size());
|
||||
List<Cookie> cookieList = new ArrayList<>(cookies.size());
|
||||
|
||||
for (SavedCookie savedCookie : cookies) {
|
||||
cookieList.add(savedCookie.getCookie());
|
||||
|
||||
@@ -91,7 +91,7 @@ public class ThrowableAnalyzer {
|
||||
* Creates a new <code>ThrowableAnalyzer</code> instance.
|
||||
*/
|
||||
public ThrowableAnalyzer() {
|
||||
this.extractorMap = new TreeMap<Class<? extends Throwable>, ThrowableCauseExtractor>(
|
||||
this.extractorMap = new TreeMap<>(
|
||||
CLASS_HIERARCHY_COMPARATOR);
|
||||
|
||||
initExtractorMap();
|
||||
|
||||
+1
-1
@@ -53,7 +53,7 @@ public class DelegatingAccessDeniedHandlerTests {
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
handlers = new LinkedHashMap<Class<? extends AccessDeniedException>, AccessDeniedHandler>();
|
||||
handlers = new LinkedHashMap<>();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
+2
-2
@@ -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(
|
||||
|
||||
+2
-2
@@ -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);
|
||||
|
||||
+1
-1
@@ -69,7 +69,7 @@ public class DelegatingAuthenticationFailureHandlerTests {
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
handlers = new LinkedHashMap<Class<? extends AuthenticationException>, AuthenticationFailureHandler>();
|
||||
handlers = new LinkedHashMap<>();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
+1
-1
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user