Skip to content

Commit

Permalink
8295823: Use enhanced-for cycle instead of Enumeration in java.naming
Browse files Browse the repository at this point in the history
Reviewed-by: aefimov, dfuchs, vtewari
  • Loading branch information
Andrey Turbanov committed Oct 26, 2022
1 parent 8e5d680 commit 46e6aee
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Expand Up @@ -215,10 +215,10 @@ public String toString() {
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;
}
}
Expand Down
Expand Up @@ -294,9 +294,8 @@ private void writeObject(java.io.ObjectOutputStream s)
// 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);
}
}

Expand Down

3 comments on commit 46e6aee

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JesperIRL
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/tag jdk-20+21

@openjdk
Copy link

@openjdk openjdk bot commented on 46e6aee Oct 27, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JesperIRL The tag jdk-20+21 was successfully created.

Please sign in to comment.