8295823: Use enhanced-for cycle instead of Enumeration in java.naming
Reviewed-by: aefimov, dfuchs, vtewari
This commit is contained in:
parent
8e5d680a98
commit
46e6aee0d0
@ -215,10 +215,10 @@ public class BasicAttribute implements Attribute {
|
|||||||
answer.append("No values");
|
answer.append("No values");
|
||||||
} else {
|
} else {
|
||||||
boolean start = true;
|
boolean start = true;
|
||||||
for (Enumeration<Object> e = values.elements(); e.hasMoreElements(); ) {
|
for (Object value : values) {
|
||||||
if (!start)
|
if (!start)
|
||||||
answer.append(", ");
|
answer.append(", ");
|
||||||
answer.append(e.nextElement());
|
answer.append(value);
|
||||||
start = false;
|
start = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -294,9 +294,8 @@ public class BasicAttributes implements Attributes {
|
|||||||
// Overridden to avoid exposing implementation details
|
// Overridden to avoid exposing implementation details
|
||||||
s.defaultWriteObject(); // write out the ignoreCase flag
|
s.defaultWriteObject(); // write out the ignoreCase flag
|
||||||
s.writeInt(attrs.size());
|
s.writeInt(attrs.size());
|
||||||
Enumeration<Attribute> attrEnum = attrs.elements();
|
for (Attribute attribute : attrs.values()) {
|
||||||
while (attrEnum.hasMoreElements()) {
|
s.writeObject(attribute);
|
||||||
s.writeObject(attrEnum.nextElement());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user