8273261: Replace 'while' cycles with iterator with enhanced-for in java.base

Reviewed-by: dfuchs, rriggs, iris, mullan
This commit is contained in:
Andrey Turbanov 2021-09-23 20:04:36 +00:00 committed by Roger Riggs
parent 0aa63feca8
commit 56b8b35286
11 changed files with 43 additions and 92 deletions

View file

@ -145,9 +145,7 @@ public final class PrivateCredentialPermission extends Permission {
} else {
this.credOwners = new CredOwner[principals.size()];
int index = 0;
Iterator<Principal> i = principals.iterator();
while (i.hasNext()) {
Principal p = i.next();
for (Principal p : principals) {
this.credOwners[index++] = new CredOwner
(p.getClass().getName(),
p.getName());