Index: java/lang/ClassLoader.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/lang/ClassLoader.java,v retrieving revision 1.56 diff -u -p -r1.56 ClassLoader.java --- java/lang/ClassLoader.java 1 Aug 2005 10:23:16 -0000 1.56 +++ java/lang/ClassLoader.java 8 Aug 2005 21:34:45 -0000 @@ -40,6 +40,7 @@ package java.lang; import gnu.classpath.SystemProperties; import gnu.classpath.VMStackWalker; +import gnu.classpath.jdwp.Jdwp; import gnu.java.util.DoubleEnumeration; import gnu.java.util.EmptyEnumeration; @@ -144,6 +145,14 @@ public abstract class ClassLoader */ private final boolean initialized; + /** + * This list is kept around for JDWP. We need a way to know every class + * that this ClassLoader has been asked to load, thus they will be added + * here. There's no need to do anything else, JDWP is able to sniff out + * private fields so we'll just sniff this field as well! + */ + final ArrayList loadRequests = new ArrayList(); + static class StaticData { /** @@ -325,23 +334,25 @@ public abstract class ClassLoader { if (parent == null) { - c = VMClassLoader.loadClass(name, resolve); - if (c != null) - return c; - } - else - { - return parent.loadClass(name, resolve); - } - } - catch (ClassNotFoundException e) - { - } - // Still not found, we have to do it ourself. - c = findClass(name); + c = VMClassLoader.loadClass(name, resolve); + } + else + { + c = parent.loadClass(name, resolve); + } + } + catch (ClassNotFoundException e) + { + } + // Still not found, we have to do it ourself. + if (c == null) + c = findClass(name); } + } if (resolve) resolveClass(c); + if (Jdwp.isDebuggingEnabled) + loadRequests.add(c); return c; }