Fix a concurrent modification error when removing all attachments.

This commit is contained in:
ElgarL 2012-04-07 17:21:48 +01:00
parent 1c0a5c49a5
commit e8dd963545
2 changed files with 8 additions and 3 deletions

View file

@ -166,4 +166,5 @@ v 2.0:
- Fix an error I caused trying to modify an unmodifiable list when parsing '*' permissions.
- Don't throw errors when attempting to remove permission attachments (bukkit will have already removed it).
- Remove all permission attachments when performing a manload or restart.
- Expand 'manwhois' to also list a users subgroups.
- Expand 'manwhois' to also list a users subgroups.
- Fix a concurrent modification error when removing all attachments.

View file

@ -20,6 +20,7 @@ import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
@ -368,8 +369,11 @@ public class BukkitPermissions {
*/
public void removeAllAttachments() {
for (Player player : attachments.keySet())
removeAttachment(player);
Iterator<Player> itr = attachments.keySet().iterator();
while (itr.hasNext()){
removeAttachment(itr.next());
}
}
/**