Salut à tous,
J'ai une erreur de type java.util.ConcurrentModificationException au niveau du 'for (String pseudo : keys)'. Pouvez-vous m'aider ?
merci
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 private void updateMap(List<Avatar> avatarList) { Set<String> keys = map.keySet(); for (String pseudo : keys) { boolean found = false; for (Avatar avatar : avatarList) { if (avatar.getPseudo().equals(pseudo)) { found = true; } } if (!found) { map.remove(pseudo); } } }
Partager