Skip to content

Commit 3eb49fe

Browse files
author
Andrey Turbanov
committedJun 6, 2022
8287766: Unnecessary Vector usage in LdapClient
Reviewed-by: dfuchs, vtewari, aefimov
1 parent 2e332c2 commit 3eb49fe

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed
 

‎src/java.naming/share/classes/com/sun/jndi/ldap/LdapClient.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
package com.sun.jndi.ldap;
2727

2828
import java.io.*;
29+
import java.util.ArrayList;
2930
import java.util.Locale;
3031
import java.util.Vector;
3132
import java.util.Hashtable;
@@ -1577,15 +1578,15 @@ void processUnsolicited(BerDecoder ber) {
15771578

15781579

15791580
private void notifyUnsolicited(Object e) {
1580-
Vector<LdapCtx> unsolicitedCopy;
1581+
ArrayList<LdapCtx> unsolicitedCopy;
15811582
synchronized (unsolicited) {
1582-
unsolicitedCopy = new Vector<>(unsolicited);
1583+
unsolicitedCopy = new ArrayList<>(unsolicited);
15831584
if (e instanceof NamingException) {
15841585
unsolicited.setSize(0); // no more listeners after exception
15851586
}
15861587
}
15871588
for (int i = 0; i < unsolicitedCopy.size(); i++) {
1588-
unsolicitedCopy.elementAt(i).fireUnsolicited(e);
1589+
unsolicitedCopy.get(i).fireUnsolicited(e);
15891590
}
15901591
}
15911592

0 commit comments

Comments
 (0)
Please sign in to comment.