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");
|
||||
} else {
|
||||
boolean start = true;
|
||||
for (Enumeration<Object> e = values.elements(); e.hasMoreElements(); ) {
|
||||
for (Object value : values) {
|
||||
if (!start)
|
||||
answer.append(", ");
|
||||
answer.append(e.nextElement());
|
||||
answer.append(value);
|
||||
start = false;
|
||||
}
|
||||
}
|
||||
|
@ -294,9 +294,8 @@ public class BasicAttributes implements Attributes {
|
||||
// Overridden to avoid exposing implementation details
|
||||
s.defaultWriteObject(); // write out the ignoreCase flag
|
||||
s.writeInt(attrs.size());
|
||||
Enumeration<Attribute> attrEnum = attrs.elements();
|
||||
while (attrEnum.hasMoreElements()) {
|
||||
s.writeObject(attrEnum.nextElement());
|
||||
for (Attribute attribute : attrs.values()) {
|
||||
s.writeObject(attribute);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user