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

@ -1489,9 +1489,7 @@ public final class Main {
info.set(X509CertInfo.SUBJECT,
dname==null?req.getSubjectName():new X500Name(dname));
CertificateExtensions reqex = null;
Iterator<PKCS10Attribute> attrs = req.getAttributes().getAttributes().iterator();
while (attrs.hasNext()) {
PKCS10Attribute attr = attrs.next();
for (PKCS10Attribute attr : req.getAttributes().getAttributes()) {
if (attr.getAttributeId().equals(PKCS9Attribute.EXTENSION_REQUEST_OID)) {
reqex = (CertificateExtensions)attr.getAttributeValue();
}