diff options
Diffstat (limited to 'loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/events')
-rw-r--r-- | loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/events/OwnerAwareASMEventHandler.java | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/events/OwnerAwareASMEventHandler.java b/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/events/OwnerAwareASMEventHandler.java index 3475e672..83f78720 100644 --- a/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/events/OwnerAwareASMEventHandler.java +++ b/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/events/OwnerAwareASMEventHandler.java @@ -4,6 +4,7 @@ import static org.objectweb.asm.Opcodes.*; import java.lang.reflect.Method; import java.util.HashMap; +import java.util.WeakHashMap; import net.minecraftforge.fml.common.ModContainer; @@ -24,7 +25,6 @@ public class OwnerAwareASMEventHandler implements IEventListener private static int IDs = 0; private static final String HANDLER_DESC = Type.getInternalName(IEventListener.class); private static final String HANDLER_FUNC_DESC = Type.getMethodDescriptor(IEventListener.class.getDeclaredMethods()[0]); - private static final HashMap<Method, Class<?>> cache = Maps.newHashMap(); private static final boolean GETCONTEXT = Boolean.parseBoolean(System.getProperty("fml.LogContext", "false")); private final IEventListener handler; @@ -63,11 +63,6 @@ public class OwnerAwareASMEventHandler implements IEventListener public Class<?> createWrapper(Method callback) { - if (cache.containsKey(callback)) - { - return cache.get(callback); - } - ClassWriter cw = new ClassWriter(0); MethodVisitor mv; @@ -116,9 +111,7 @@ public class OwnerAwareASMEventHandler implements IEventListener mv.visitEnd(); } cw.visitEnd(); - Class<?> ret = new ASMClassLoader(callback.getDeclaringClass().getClassLoader()).define(name, cw.toByteArray()); - cache.put(callback, ret); - return ret; + return new ASMClassLoader(callback.getDeclaringClass().getClassLoader()).define(name, cw.toByteArray()); } private String getUniqueName(Method callback) |