java.util.ConcurrentModificationException on ArrayList
问题 I have a Server class and a Timer inside it which is supposed to clear dead clients (clients who crashed). I followed the example below by locking the collection when the Timer iterates over the users but I still get this exception (after I crash a connected client). http://www.javaperformancetuning.com/articles/fastfail2.shtml List<User> users; List<User> connectedUsers; ConcurrentMap<User, IClient> clients; ... users = Collections.synchronizedList(new ArrayList<User>()); connectedUsers =