diff options
author | ElgarL <ElgarL@palmergames.com> | 2012-06-24 13:10:22 +0100 |
---|---|---|
committer | ElgarL <ElgarL@palmergames.com> | 2012-06-24 13:10:22 +0100 |
commit | 1e880373d43752485e85d6ee09fc210f8c77f326 (patch) | |
tree | e76e872939603fd630ee3f2668979b0a02c4cfa5 /EssentialsGroupManager | |
parent | 2b3a1b3778efc2d1b745a3d50898e4a4270a355c (diff) | |
download | Essentials-1e880373d43752485e85d6ee09fc210f8c77f326.tar Essentials-1e880373d43752485e85d6ee09fc210f8c77f326.tar.gz Essentials-1e880373d43752485e85d6ee09fc210f8c77f326.tar.lz Essentials-1e880373d43752485e85d6ee09fc210f8c77f326.tar.xz Essentials-1e880373d43752485e85d6ee09fc210f8c77f326.zip |
Fix loading users with only numerals in their names to be seen as
strings.
Diffstat (limited to 'EssentialsGroupManager')
-rw-r--r-- | EssentialsGroupManager/src/Changelog.txt | 3 | ||||
-rw-r--r-- | EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java | 10 |
2 files changed, 10 insertions, 3 deletions
diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt index 134d40250..3b44270c6 100644 --- a/EssentialsGroupManager/src/Changelog.txt +++ b/EssentialsGroupManager/src/Changelog.txt @@ -184,4 +184,5 @@ v 2.0: - Prevent null perms getting past the GlobalGroups loader.
- Fix forgetting sub groups on a manload.
- Allow 'manucheckp' to notify when superperms reports false but it is really negated.
- - Only output a Data update message if something has changed.
\ No newline at end of file + - Only output a Data update message if something has changed.
+ - Fix loading users with only numerals in their names to be seen as strings.
\ No newline at end of file diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java index fefc698f9..1ccd48772 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java @@ -775,20 +775,26 @@ public class WorldDataHolder { Iterator<String> usersItr = allUsersNode.keySet().iterator(); String usersKey; + Object node; Integer userCount = 0; while (usersItr.hasNext()) { try { userCount++; // Attempt to fetch the next user name. - usersKey = usersItr.next(); + node = usersItr.next(); + if (node instanceof Integer) + usersKey = Integer.toString((Integer)node); + else + usersKey = node.toString(); + } catch (Exception ex) { throw new IllegalArgumentException("Invalid node type for user entry (" + userCount + ") in file: " + usersFile.getPath(), ex); } Map<String, Object> thisUserNode = null; try { - thisUserNode = (Map<String, Object>) allUsersNode.get(usersKey); + thisUserNode = (Map<String, Object>) allUsersNode.get(node); } catch (Exception ex) { throw new IllegalArgumentException("Bad format found for user: " + usersKey + " in file: " + usersFile.getPath()); } |