I make a team of 4 players and asked to use a sublist. Here is the list:
private final static List<Player> players = new LinkedList<Player>(); private final static List<Player> waitingPlayers = new LinkedList<Player>();
I get this error:
java.util.ConcurrentModificationException [11/25/11 3:36 PM]: at java.util.SubList.checkForComodification(Unknown Sour ce) [11/25/11 3:36 PM]: at java.util.SubList.listIterator(Unknown Source) [11/25/11 3:36 PM]: at java.util.AbstractList.listIterator(Unknown Source) [11/25/11 3:36 PM]: at java.util.SubList.iterator(Unknown Source) [11/25/11 3:36 PM]: at java.util.AbstractCollection.contains(Unknown Source) [11/25/11 3:36 PM]: at java.util.AbstractCollection.removeAll(Unknown Source)
indicated here.
public static void enterGame(final Client c) { if(waitingPlayers.size() < 4) { c.sendMessage("Waiting for 4 players"); return;
source share