Commits

Chris Thunes committed a5d4e3d

Fix ConcurrentModificationException

Comments (0)

Files changed (1)

brewtab-irc/src/main/java/com/brewtab/irc/impl/ConnectionImpl.java

 import java.util.List;
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.CopyOnWriteArrayList;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
         connected = false;
 
         messageListeners = new ConcurrentHashMap<MessageListener, MessageFilter>();
-        connectionStateListeners = Collections.synchronizedList(new ArrayList<ConnectionStateListener>());
+        connectionStateListeners = new CopyOnWriteArrayList<ConnectionStateListener>();
 
         executor = Executors.newCachedThreadPool();
     }