mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8273261: Replace 'while' cycles with iterator with enhanced-for in java.base
Reviewed-by: dfuchs, rriggs, iris, mullan
This commit is contained in:
parent
0aa63feca8
commit
56b8b35286
11 changed files with 43 additions and 92 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -314,9 +314,7 @@ public class X509CRLSelector implements CRLSelector {
|
|||
throws IOException
|
||||
{
|
||||
HashSet<Object> namesCopy = new HashSet<>();
|
||||
Iterator<?> i = names.iterator();
|
||||
while (i.hasNext()) {
|
||||
Object nameObject = i.next();
|
||||
for (Object nameObject : names) {
|
||||
if (!(nameObject instanceof byte []) &&
|
||||
!(nameObject instanceof String))
|
||||
throw new IOException("name not byte array or String");
|
||||
|
@ -573,9 +571,8 @@ public class X509CRLSelector implements CRLSelector {
|
|||
sb.append("X509CRLSelector: [\n");
|
||||
if (issuerNames != null) {
|
||||
sb.append(" IssuerNames:\n");
|
||||
Iterator<Object> i = issuerNames.iterator();
|
||||
while (i.hasNext())
|
||||
sb.append(" " + i.next() + "\n");
|
||||
for (Object issuerName : issuerNames)
|
||||
sb.append(" " + issuerName + "\n");
|
||||
}
|
||||
if (minCRL != null)
|
||||
sb.append(" minCRLNumber: " + minCRL + "\n");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue