From 9d820c94a6ff82ee4fef33d0b4e4389282d03d7e Mon Sep 17 00:00:00 2001 From: ElgarL Date: Mon, 10 Sep 2012 00:15:42 +0100 Subject: Change to Hashtables to reduce the chance of a ConcurrentModificationException pulling group/user data in an Async thread. --- .../src/org/anjocaido/groupmanager/dataholder/GroupsDataHolder.java | 6 +++--- .../src/org/anjocaido/groupmanager/dataholder/UsersDataHolder.java | 6 +++--- .../org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java | 5 +++-- 3 files changed, 9 insertions(+), 8 deletions(-) (limited to 'EssentialsGroupManager/src/org') diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/GroupsDataHolder.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/GroupsDataHolder.java index eaaaace74..ed6a985ed 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/GroupsDataHolder.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/GroupsDataHolder.java @@ -1,7 +1,7 @@ package org.anjocaido.groupmanager.dataholder; import java.io.File; -import java.util.HashMap; +import java.util.Hashtable; import java.util.Map; import org.anjocaido.groupmanager.data.Group; @@ -23,7 +23,7 @@ public class GroupsDataHolder { /** * The actual groups holder */ - private Map groups = new HashMap(); + private Hashtable groups = new Hashtable(); /** * Constructor @@ -69,7 +69,7 @@ public class GroupsDataHolder { */ public void setGroups(Map groups) { - this.groups = groups; + this.groups = (Hashtable) groups; } /** diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/UsersDataHolder.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/UsersDataHolder.java index 665fe227d..3ddc2177d 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/UsersDataHolder.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/UsersDataHolder.java @@ -1,7 +1,7 @@ package org.anjocaido.groupmanager.dataholder; import java.io.File; -import java.util.HashMap; +import java.util.Hashtable; import java.util.Map; import org.anjocaido.groupmanager.data.User; @@ -22,7 +22,7 @@ public class UsersDataHolder { /** * The actual groups holder */ - private Map users = new HashMap(); + private Hashtable users = new Hashtable(); /** * Constructor @@ -53,7 +53,7 @@ public class UsersDataHolder { */ public void setUsers(Map users) { - this.users = users; + this.users = (Hashtable) users; } /** diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java index f84262eeb..2a6463fe3 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java @@ -11,6 +11,7 @@ import java.io.InputStream; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; +import java.util.Hashtable; import java.util.List; import java.util.Map; import java.util.Properties; @@ -33,7 +34,7 @@ public class WorldsHolder { /** * Map with instances of loaded worlds. */ - private Map worldsData = new HashMap(); + private Hashtable worldsData = new Hashtable(); /** * Map of mirrors: @@ -61,7 +62,7 @@ public class WorldsHolder { public void resetWorldsHolder() { - worldsData = new HashMap(); + worldsData = new Hashtable(); mirrorsGroup = new HashMap(); mirrorsUser = new HashMap(); -- cgit v1.2.3