|
|
@ -56,12 +56,9 @@ public class ClassFileLoader implements ClassInfoLoader { |
|
|
|
|
|
|
|
|
|
|
|
private static final int CACHE_LIMIT = 10; |
|
|
|
private static final int CACHE_LIMIT = 10; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
private ClassSource _classSource; |
|
|
|
* Constructor. The classpath initially consists of the contents of the |
|
|
|
|
|
|
|
* <tt>java.class.path</tt> and <tt>sun.boot.class.path</tt> system |
|
|
|
public ClassFileLoader(ClassSource classSource) { |
|
|
|
* properties. |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public ClassFileLoader() { |
|
|
|
|
|
|
|
outputDir = new File("."); |
|
|
|
outputDir = new File("."); |
|
|
|
classpath = System.getProperty("java.class.path"); |
|
|
|
classpath = System.getProperty("java.class.path"); |
|
|
|
classpath += File.pathSeparator |
|
|
|
classpath += File.pathSeparator |
|
|
@ -73,6 +70,16 @@ public class ClassFileLoader implements ClassInfoLoader { |
|
|
|
openZipFiles = new HashMap(); |
|
|
|
openZipFiles = new HashMap(); |
|
|
|
cache = new LinkedList(); |
|
|
|
cache = new LinkedList(); |
|
|
|
verbose = false; |
|
|
|
verbose = false; |
|
|
|
|
|
|
|
_classSource = classSource; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Constructor. The classpath initially consists of the contents of the |
|
|
|
|
|
|
|
* <tt>java.class.path</tt> and <tt>sun.boot.class.path</tt> system |
|
|
|
|
|
|
|
* properties. |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public ClassFileLoader() { |
|
|
|
|
|
|
|
this(new DefaultClassSource()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void setVerbose(final boolean verbose) { |
|
|
|
public void setVerbose(final boolean verbose) { |
|
|
@ -205,7 +212,7 @@ public class ClassFileLoader implements ClassInfoLoader { |
|
|
|
private ClassInfo loadClassFromRessource(String name){ |
|
|
|
private ClassInfo loadClassFromRessource(String name){ |
|
|
|
name = name.replaceAll("/","."); |
|
|
|
name = name.replaceAll("/","."); |
|
|
|
try { |
|
|
|
try { |
|
|
|
Class clazz = Class.forName(name); |
|
|
|
Class clazz = _classSource.loadClass(name); |
|
|
|
int i = name.lastIndexOf('.'); |
|
|
|
int i = name.lastIndexOf('.'); |
|
|
|
if (i >= 0 && i < name.length()){ |
|
|
|
if (i >= 0 && i < name.length()){ |
|
|
|
name = name.substring(i+1); |
|
|
|
name = name.substring(i+1); |
|
|
|