From 833713bee2c891fab6f51b1465c9d786f74c3023 Mon Sep 17 00:00:00 2001 From: vemacs Date: Tue, 1 Mar 2016 11:49:54 -0700 Subject: [PATCH] setAccessible(true) on legacy cache methods --- Essentials/src/com/earth2me/essentials/UserMap.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Essentials/src/com/earth2me/essentials/UserMap.java b/Essentials/src/com/earth2me/essentials/UserMap.java index 50768644d..9ebb67daa 100644 --- a/Essentials/src/com/earth2me/essentials/UserMap.java +++ b/Essentials/src/com/earth2me/essentials/UserMap.java @@ -289,6 +289,7 @@ public class UserMap extends CacheLoader implements IConf { private void legacyMaximumSize(CacheBuilder builder, int maxCount) { try { Method maxSizeLegacy = builder.getClass().getDeclaredMethod("maximumSize", Integer.TYPE); + maxSizeLegacy.setAccessible(true); maxSizeLegacy.invoke(builder, maxCount); } catch (NoSuchMethodException | InvocationTargetException | IllegalAccessException e) { e.printStackTrace(); @@ -307,6 +308,7 @@ public class UserMap extends CacheLoader implements IConf { Cache legacyUsers; try { assert build != null; + build.setAccessible(true); legacyUsers = (Cache) build.invoke(builder, this); } catch (IllegalAccessException | InvocationTargetException e) { legacyUsers = null;