diff --git a/Essentials/src/com/earth2me/essentials/UserMap.java b/Essentials/src/com/earth2me/essentials/UserMap.java index 84ae92aee..567c1a0d4 100644 --- a/Essentials/src/com/earth2me/essentials/UserMap.java +++ b/Essentials/src/com/earth2me/essentials/UserMap.java @@ -18,14 +18,13 @@ import java.util.concurrent.ConcurrentSkipListMap; import java.util.concurrent.ConcurrentSkipListSet; import java.util.concurrent.ExecutionException; import net.ess3.api.IEssentials; -import org.bukkit.Bukkit; import org.bukkit.entity.Player; -public class UserMap extends CacheLoader implements IConf +public class UserMap extends CacheLoader implements IConf { private final transient IEssentials ess; - private final transient Cache users; + private final transient Cache users; private final transient ConcurrentSkipListSet keys = new ConcurrentSkipListSet(); private final transient ConcurrentSkipListMap names = new ConcurrentSkipListMap(); private final transient ConcurrentSkipListMap> history = new ConcurrentSkipListMap>(); @@ -92,7 +91,7 @@ public class UserMap extends CacheLoader implements IConf if (names.containsKey(sanitizedName)) { final UUID uuid = names.get(sanitizedName); - return users.get(uuid); + return getUser(uuid); } final File userFile = getUserFileFromString(sanitizedName); @@ -105,10 +104,6 @@ public class UserMap extends CacheLoader implements IConf } return null; } - catch (ExecutionException ex) - { - return null; - } catch (UncheckedExecutionException ex) { return null; @@ -119,7 +114,7 @@ public class UserMap extends CacheLoader implements IConf { try { - return users.get(uuid); + return users.get(uuid.toString()); } catch (ExecutionException ex) { @@ -149,8 +144,9 @@ public class UserMap extends CacheLoader implements IConf } @Override - public User load(final UUID uuid) throws Exception + public User load(final String stringUUID) throws Exception { + UUID uuid = UUID.fromString(stringUUID); Player player = ess.getServer().getPlayer(uuid); if (player != null) { @@ -206,7 +202,7 @@ public class UserMap extends CacheLoader implements IConf { return keys.size(); } - + protected ConcurrentSkipListMap getNames() { return names;