Use foreach where possible
This commit is contained in:
committed by
Josh Cummings
parent
7dc28ff376
commit
43737a56bd
+2
-2
@@ -129,8 +129,8 @@ public class SimpleRoles2GrantedAuthoritiesMapperTests {
|
||||
List<GrantedAuthority> result = mapper
|
||||
.getGrantedAuthorities(Arrays.asList(roles));
|
||||
Collection<String> resultColl = new ArrayList<>(result.size());
|
||||
for (int i = 0; i < result.size(); i++) {
|
||||
resultColl.add(result.get(i).getAuthority());
|
||||
for (GrantedAuthority grantedAuthority : result) {
|
||||
resultColl.add(grantedAuthority.getAuthority());
|
||||
}
|
||||
Collection<String> expectedColl = Arrays.asList(expectedGas);
|
||||
assertThat(expectedColl.containsAll(resultColl)
|
||||
|
||||
+2
-2
@@ -180,8 +180,8 @@ public class SessionRegistryImplTests {
|
||||
private boolean contains(String sessionId, Object principal) {
|
||||
List<SessionInformation> info = sessionRegistry.getAllSessions(principal, false);
|
||||
|
||||
for (int i = 0; i < info.size(); i++) {
|
||||
if (sessionId.equals(info.get(i).getSessionId())) {
|
||||
for (SessionInformation sessionInformation : info) {
|
||||
if (sessionId.equals(sessionInformation.getSessionId())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user