summaryrefslogtreecommitdiffstats
path: root/EssentialsGroupManager/src
diff options
context:
space:
mode:
authorElgarL <ElgarL@palmergames.com>2012-09-10 00:15:42 +0100
committerElgarL <ElgarL@palmergames.com>2012-09-10 00:15:42 +0100
commit96ab1b4533b62464b8325373e677209290bced3e (patch)
tree805f82a1d7e6d9b0b88fb12a9a6de2f0300a108b /EssentialsGroupManager/src
parent79c70b1f657f5de77119e494a632a9335a5154bb (diff)
downloadEssentials-96ab1b4533b62464b8325373e677209290bced3e.tar
Essentials-96ab1b4533b62464b8325373e677209290bced3e.tar.gz
Essentials-96ab1b4533b62464b8325373e677209290bced3e.tar.lz
Essentials-96ab1b4533b62464b8325373e677209290bced3e.tar.xz
Essentials-96ab1b4533b62464b8325373e677209290bced3e.zip
Change to Hashtables to reduce the chance of a
ConcurrentModificationException pulling group/user data in an Async thread.
Diffstat (limited to 'EssentialsGroupManager/src')
-rw-r--r--EssentialsGroupManager/src/Changelog.txt3
-rw-r--r--EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/GroupsDataHolder.java6
-rw-r--r--EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/UsersDataHolder.java6
-rw-r--r--EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java5
4 files changed, 11 insertions, 9 deletions
diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt
index 5b409d773..5c1ea2cd2 100644
--- a/EssentialsGroupManager/src/Changelog.txt
+++ b/EssentialsGroupManager/src/Changelog.txt
@@ -196,4 +196,5 @@ v 2.0:
- Fix an error with Logging set to 'OFF' triggering a cast exception.
- No more null errors from corrupt config.yml's.
- Give a better error when a subgroup is null.
- - Include the GM version when logging errors. \ No newline at end of file
+ - Include the GM version when logging errors.
+ - Change to Hashtables to reduce the chance of a ConcurrentModificationException pulling group/user data in an Async thread. \ No newline at end of file
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<String, Group> groups = new HashMap<String, Group>();
+ private Hashtable<String, Group> groups = new Hashtable<String, Group>();
/**
* Constructor
@@ -69,7 +69,7 @@ public class GroupsDataHolder {
*/
public void setGroups(Map<String, Group> groups) {
- this.groups = groups;
+ this.groups = (Hashtable<String, Group>) 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<String, User> users = new HashMap<String, User>();
+ private Hashtable<String, User> users = new Hashtable<String, User>();
/**
* Constructor
@@ -53,7 +53,7 @@ public class UsersDataHolder {
*/
public void setUsers(Map<String, User> users) {
- this.users = users;
+ this.users = (Hashtable<String, User>) 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<String, OverloadedWorldHolder> worldsData = new HashMap<String, OverloadedWorldHolder>();
+ private Hashtable<String, OverloadedWorldHolder> worldsData = new Hashtable<String, OverloadedWorldHolder>();
/**
* Map of mirrors: <nonExistingWorldName, existingAndLoadedWorldName>
@@ -61,7 +62,7 @@ public class WorldsHolder {
public void resetWorldsHolder() {
- worldsData = new HashMap<String, OverloadedWorldHolder>();
+ worldsData = new Hashtable<String, OverloadedWorldHolder>();
mirrorsGroup = new HashMap<String, String>();
mirrorsUser = new HashMap<String, String>();