diff --git a/Essentials/src/com/earth2me/essentials/UserMap.java b/Essentials/src/com/earth2me/essentials/UserMap.java index b2888ef5e..50768644d 100644 --- a/Essentials/src/com/earth2me/essentials/UserMap.java +++ b/Essentials/src/com/earth2me/essentials/UserMap.java @@ -28,6 +28,7 @@ public class UserMap extends CacheLoader implements IConf { private UUIDMap uuidMap; private final transient Cache users; + private static boolean legacy = false; public UserMap(final IEssentials ess) { super(); @@ -37,7 +38,6 @@ public class UserMap extends CacheLoader implements IConf { //users = CacheBuilder.newBuilder().maximumSize(ess.getSettings().getMaxUserCacheCount()).softValues().removalListener(remListener).build(this); CacheBuilder cacheBuilder = CacheBuilder.newBuilder(); int maxCount = ess.getSettings().getMaxUserCacheCount(); - boolean legacy = false; try { cacheBuilder.maximumSize(maxCount); } catch (NoSuchMethodError nsme) { @@ -107,9 +107,9 @@ public class UserMap extends CacheLoader implements IConf { public User getUser(final UUID uuid) { try { - try { + if (!legacy) { return ((LoadingCache) users).get(uuid.toString()); - } catch (SecurityException | ClassCastException e) { + } else { return legacyCacheGet(uuid); } } catch (ExecutionException ex) {