Cleanup explicit type arguments
This commit is contained in:
+2
-2
@@ -176,7 +176,7 @@ public class RoleHierarchyImpl implements RoleHierarchy {
|
||||
* will become a key that references a set of the reachable lower roles.
|
||||
*/
|
||||
private void buildRolesReachableInOneStepMap() {
|
||||
this.rolesReachableInOneStepMap = new HashMap<GrantedAuthority, Set<GrantedAuthority>>();
|
||||
this.rolesReachableInOneStepMap = new HashMap<>();
|
||||
try (BufferedReader bufferedReader = new BufferedReader(
|
||||
new StringReader(this.roleHierarchyStringRepresentation))) {
|
||||
for (String readLine; (readLine = bufferedReader.readLine()) != null;) {
|
||||
@@ -187,7 +187,7 @@ public class RoleHierarchyImpl implements RoleHierarchy {
|
||||
GrantedAuthority lowerRole = new SimpleGrantedAuthority(roles[i].replaceAll("^\\s+|\\s+$", ""));
|
||||
Set<GrantedAuthority> rolesReachableInOneStepSet;
|
||||
if (!this.rolesReachableInOneStepMap.containsKey(higherRole)) {
|
||||
rolesReachableInOneStepSet = new HashSet<GrantedAuthority>();
|
||||
rolesReachableInOneStepSet = new HashSet<>();
|
||||
this.rolesReachableInOneStepMap.put(higherRole, rolesReachableInOneStepSet);
|
||||
} else {
|
||||
rolesReachableInOneStepSet = this.rolesReachableInOneStepMap.get(higherRole);
|
||||
|
||||
+1
-1
@@ -42,7 +42,7 @@ public final class DelegatingMethodSecurityMetadataSource extends
|
||||
.emptyList();
|
||||
|
||||
private final List<MethodSecurityMetadataSource> methodSecurityMetadataSources;
|
||||
private final Map<DefaultCacheKey, Collection<ConfigAttribute>> attributeCache = new HashMap<DefaultCacheKey, Collection<ConfigAttribute>>();
|
||||
private final Map<DefaultCacheKey, Collection<ConfigAttribute>> attributeCache = new HashMap<>();
|
||||
|
||||
// ~ Constructor
|
||||
// ====================================================================================================
|
||||
|
||||
+1
-1
@@ -63,7 +63,7 @@ public class DefaultAuthenticationEventPublisher implements AuthenticationEventP
|
||||
private final Log logger = LogFactory.getLog(getClass());
|
||||
|
||||
private ApplicationEventPublisher applicationEventPublisher;
|
||||
private final HashMap<String, Constructor<? extends AbstractAuthenticationEvent>> exceptionMappings = new HashMap<String, Constructor<? extends AbstractAuthenticationEvent>>();
|
||||
private final HashMap<String, Constructor<? extends AbstractAuthenticationEvent>> exceptionMappings = new HashMap<>();
|
||||
|
||||
public DefaultAuthenticationEventPublisher() {
|
||||
this(null);
|
||||
|
||||
+2
-2
@@ -131,7 +131,7 @@ public class DelegatingSecurityContextExecutorService extends
|
||||
if (tasks == null) {
|
||||
return null;
|
||||
}
|
||||
List<Callable<T>> results = new ArrayList<Callable<T>>(tasks.size());
|
||||
List<Callable<T>> results = new ArrayList<>(tasks.size());
|
||||
for (Callable<T> task : tasks) {
|
||||
results.add(wrap(task));
|
||||
}
|
||||
@@ -141,4 +141,4 @@ public class DelegatingSecurityContextExecutorService extends
|
||||
private ExecutorService getDelegate() {
|
||||
return (ExecutorService) getDelegateExecutor();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -88,7 +88,7 @@ public class MapBasedAttributes2GrantedAuthoritiesMapper implements
|
||||
* @return the processed Map
|
||||
*/
|
||||
private Map<String, Collection<GrantedAuthority>> preProcessMap(Map<?, ?> orgMap) {
|
||||
Map<String, Collection<GrantedAuthority>> result = new HashMap<String, Collection<GrantedAuthority>>(
|
||||
Map<String, Collection<GrantedAuthority>> result = new HashMap<>(
|
||||
orgMap.size());
|
||||
|
||||
for (Map.Entry<?, ?> entry : orgMap.entrySet()) {
|
||||
|
||||
+1
-1
@@ -43,7 +43,7 @@ class UnmodifiableListDeserializer extends JsonDeserializer<List> {
|
||||
public List deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException {
|
||||
ObjectMapper mapper = (ObjectMapper) jp.getCodec();
|
||||
JsonNode node = mapper.readTree(jp);
|
||||
List<Object> result = new ArrayList<Object>();
|
||||
List<Object> result = new ArrayList<>();
|
||||
if (node != null) {
|
||||
if (node instanceof ArrayNode) {
|
||||
ArrayNode arrayNode = (ArrayNode) node;
|
||||
|
||||
+5
-5
@@ -39,7 +39,7 @@ public class RoleHierarchyUtilsTests {
|
||||
"ROLE_C > ROLE_D" + EOL;
|
||||
// @formatter:on
|
||||
|
||||
Map<String, List<String>> roleHierarchyMap = new TreeMap<String, List<String>>();
|
||||
Map<String, List<String>> roleHierarchyMap = new TreeMap<>();
|
||||
roleHierarchyMap.put("ROLE_A", asList("ROLE_B", "ROLE_C"));
|
||||
roleHierarchyMap.put("ROLE_B", asList("ROLE_D"));
|
||||
roleHierarchyMap.put("ROLE_C", asList("ROLE_D"));
|
||||
@@ -61,7 +61,7 @@ public class RoleHierarchyUtilsTests {
|
||||
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
public void roleHierarchyFromMapWhenRoleNullThenThrowsIllegalArgumentException() throws Exception {
|
||||
Map<String, List<String>> roleHierarchyMap = new HashMap<String, List<String>>();
|
||||
Map<String, List<String>> roleHierarchyMap = new HashMap<>();
|
||||
roleHierarchyMap.put(null, asList("ROLE_B", "ROLE_C"));
|
||||
|
||||
RoleHierarchyUtils.roleHierarchyFromMap(roleHierarchyMap);
|
||||
@@ -69,7 +69,7 @@ public class RoleHierarchyUtilsTests {
|
||||
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
public void roleHierarchyFromMapWhenRoleEmptyThenThrowsIllegalArgumentException() throws Exception {
|
||||
Map<String, List<String>> roleHierarchyMap = new HashMap<String, List<String>>();
|
||||
Map<String, List<String>> roleHierarchyMap = new HashMap<>();
|
||||
roleHierarchyMap.put("", asList("ROLE_B", "ROLE_C"));
|
||||
|
||||
RoleHierarchyUtils.roleHierarchyFromMap(roleHierarchyMap);
|
||||
@@ -77,7 +77,7 @@ public class RoleHierarchyUtilsTests {
|
||||
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
public void roleHierarchyFromMapWhenImpliedRolesNullThenThrowsIllegalArgumentException() throws Exception {
|
||||
Map<String, List<String>> roleHierarchyMap = new HashMap<String, List<String>>();
|
||||
Map<String, List<String>> roleHierarchyMap = new HashMap<>();
|
||||
roleHierarchyMap.put("ROLE_A", null);
|
||||
|
||||
RoleHierarchyUtils.roleHierarchyFromMap(roleHierarchyMap);
|
||||
@@ -85,7 +85,7 @@ public class RoleHierarchyUtilsTests {
|
||||
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
public void roleHierarchyFromMapWhenImpliedRolesEmptyThenThrowsIllegalArgumentException() throws Exception {
|
||||
Map<String, List<String>> roleHierarchyMap = new HashMap<String, List<String>>();
|
||||
Map<String, List<String>> roleHierarchyMap = new HashMap<>();
|
||||
roleHierarchyMap.put("ROLE_A", Collections.<String>emptyList());
|
||||
|
||||
RoleHierarchyUtils.roleHierarchyFromMap(roleHierarchyMap);
|
||||
|
||||
+1
-1
@@ -113,7 +113,7 @@ public class ConsensusBasedTests {
|
||||
RoleVoter roleVoter = new RoleVoter();
|
||||
DenyVoter denyForSureVoter = new DenyVoter();
|
||||
DenyAgainVoter denyAgainForSureVoter = new DenyAgainVoter();
|
||||
List<AccessDecisionVoter<? extends Object>> voters = new Vector<AccessDecisionVoter<? extends Object>>();
|
||||
List<AccessDecisionVoter<? extends Object>> voters = new Vector<>();
|
||||
voters.add(roleVoter);
|
||||
voters.add(denyForSureVoter);
|
||||
voters.add(denyAgainForSureVoter);
|
||||
|
||||
+2
-2
@@ -43,7 +43,7 @@ public class UnanimousBasedTests {
|
||||
RoleVoter roleVoter = new RoleVoter();
|
||||
DenyVoter denyForSureVoter = new DenyVoter();
|
||||
DenyAgainVoter denyAgainForSureVoter = new DenyAgainVoter();
|
||||
List<AccessDecisionVoter<? extends Object>> voters = new Vector<AccessDecisionVoter<? extends Object>>();
|
||||
List<AccessDecisionVoter<? extends Object>> voters = new Vector<>();
|
||||
voters.add(roleVoter);
|
||||
voters.add(denyForSureVoter);
|
||||
voters.add(denyAgainForSureVoter);
|
||||
@@ -56,7 +56,7 @@ public class UnanimousBasedTests {
|
||||
|
||||
DenyVoter denyForSureVoter = new DenyVoter();
|
||||
DenyAgainVoter denyAgainForSureVoter = new DenyAgainVoter();
|
||||
List<AccessDecisionVoter<? extends Object>> voters = new Vector<AccessDecisionVoter<? extends Object>>();
|
||||
List<AccessDecisionVoter<? extends Object>> voters = new Vector<>();
|
||||
voters.add(roleVoter);
|
||||
voters.add(denyForSureVoter);
|
||||
voters.add(denyAgainForSureVoter);
|
||||
|
||||
Reference in New Issue
Block a user