mirror of
https://github.com/openjdk/jdk.git
synced 2026-02-18 06:15:16 +00:00
8287766: Unnecessary Vector usage in LdapClient
Reviewed-by: dfuchs, vtewari, aefimov
This commit is contained in:
parent
2e332c2760
commit
3eb49fecea
@ -26,6 +26,7 @@
|
||||
package com.sun.jndi.ldap;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Locale;
|
||||
import java.util.Vector;
|
||||
import java.util.Hashtable;
|
||||
@ -1577,15 +1578,15 @@ public final class LdapClient implements PooledConnection {
|
||||
|
||||
|
||||
private void notifyUnsolicited(Object e) {
|
||||
Vector<LdapCtx> unsolicitedCopy;
|
||||
ArrayList<LdapCtx> unsolicitedCopy;
|
||||
synchronized (unsolicited) {
|
||||
unsolicitedCopy = new Vector<>(unsolicited);
|
||||
unsolicitedCopy = new ArrayList<>(unsolicited);
|
||||
if (e instanceof NamingException) {
|
||||
unsolicited.setSize(0); // no more listeners after exception
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < unsolicitedCopy.size(); i++) {
|
||||
unsolicitedCopy.elementAt(i).fireUnsolicited(e);
|
||||
unsolicitedCopy.get(i).fireUnsolicited(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user