diff --git a/src/main/java/com/realtimetech/reflection/classloader/ClassDynamicLoader.java b/src/main/java/com/realtimetech/reflection/classloader/ClassDynamicLoader.java index c285687..b89f412 100644 --- a/src/main/java/com/realtimetech/reflection/classloader/ClassDynamicLoader.java +++ b/src/main/java/com/realtimetech/reflection/classloader/ClassDynamicLoader.java @@ -1,10 +1,12 @@ package com.realtimetech.reflection.classloader; +import java.net.URL; +import java.net.URLClassLoader; import java.util.HashMap; import com.realtimetech.reflection.classfile.file.ClassFile; -public class ClassDynamicLoader extends ClassLoader { +public class ClassDynamicLoader extends URLClassLoader { private HashMap classMap; public ClassDynamicLoader() { @@ -12,10 +14,14 @@ public ClassDynamicLoader() { } public ClassDynamicLoader(ClassLoader classLoader) { - super(classLoader); + super(new URL[0], classLoader); this.classMap = new HashMap(); } + public void addURL(URL url) { + super.addURL(url); + } + public void addClass(String className, byte[] bytes) { this.classMap.put(className, bytes); }