File tree 2 files changed +4
-5
lines changed
src/java.naming/share/classes/javax/naming/directory
2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -215,10 +215,10 @@ public String toString() {
215
215
answer .append ("No values" );
216
216
} else {
217
217
boolean start = true ;
218
- for (Enumeration < Object > e = values . elements (); e . hasMoreElements (); ) {
218
+ for (Object value : values ) {
219
219
if (!start )
220
220
answer .append (", " );
221
- answer .append (e . nextElement () );
221
+ answer .append (value );
222
222
start = false ;
223
223
}
224
224
}
Original file line number Diff line number Diff line change @@ -294,9 +294,8 @@ private void writeObject(java.io.ObjectOutputStream s)
294
294
// Overridden to avoid exposing implementation details
295
295
s .defaultWriteObject (); // write out the ignoreCase flag
296
296
s .writeInt (attrs .size ());
297
- Enumeration <Attribute > attrEnum = attrs .elements ();
298
- while (attrEnum .hasMoreElements ()) {
299
- s .writeObject (attrEnum .nextElement ());
297
+ for (Attribute attribute : attrs .values ()) {
298
+ s .writeObject (attribute );
300
299
}
301
300
}
302
301
You can’t perform that action at this time.
0 commit comments