mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-28 11:25:35 +02:00
Bug 463530 - Avoid ConcurrentModificationException in listener list
Change-Id: I82c876b1162acfc6b464e535c6c54469c87bb114 Signed-off-by: Greg Watson <g.watson@computer.org>
This commit is contained in:
parent
d36eb06f7c
commit
56b0c45b4f
1 changed files with 6 additions and 6 deletions
|
@ -10,12 +10,11 @@
|
|||
*******************************************************************************/
|
||||
package org.eclipse.remote.internal.core;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.core.runtime.ListenerList;
|
||||
import org.eclipse.equinox.security.storage.ISecurePreferences;
|
||||
import org.eclipse.equinox.security.storage.StorageException;
|
||||
import org.eclipse.remote.core.IRemoteConnection;
|
||||
|
@ -42,7 +41,7 @@ public class RemoteConnection implements IRemoteConnection {
|
|||
|
||||
private final Map<String, Object> servicesMap = new HashMap<>();
|
||||
|
||||
private final List<IRemoteConnectionChangeListener> fListeners = new ArrayList<>();
|
||||
private final ListenerList fListeners = new ListenerList();
|
||||
|
||||
final static String EMPTY_STRING = ""; //$NON-NLS-1$
|
||||
|
||||
|
@ -244,7 +243,8 @@ public class RemoteConnection implements IRemoteConnection {
|
|||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.remote.core.IRemoteConnection#removeConnectionChangeListener(org.eclipse.remote.core.IRemoteConnectionChangeListener
|
||||
* org.eclipse.remote.core.IRemoteConnection#removeConnectionChangeListener(org.eclipse.remote.core.
|
||||
* IRemoteConnectionChangeListener
|
||||
* )
|
||||
*/
|
||||
@Override
|
||||
|
@ -260,8 +260,8 @@ public class RemoteConnection implements IRemoteConnection {
|
|||
@Override
|
||||
public void fireConnectionChangeEvent(final int type) {
|
||||
RemoteConnectionChangeEvent event = new RemoteConnectionChangeEvent(this, type);
|
||||
for (IRemoteConnectionChangeListener listener : fListeners) {
|
||||
listener.connectionChanged(event);
|
||||
for (Object listener : fListeners.getListeners()) {
|
||||
((IRemoteConnectionChangeListener) listener).connectionChanged(event);
|
||||
}
|
||||
// fire to the global listeners too
|
||||
connectionType.getRemoteServicesManager().fireRemoteConnectionChangeEvent(event);
|
||||
|
|
Loading…
Add table
Reference in a new issue