Andrew Haley writes:
2004-10-29 Andrew Haley <address@hidden>
* java/net/URLClassLoader.java (JarURLLoader.classPath,
JarURLLoader.extensionURLLoaders): new fields.
(JarURLLoader.getExtensionURLLoaders): New method.
(URLClassLoader.getURLLoader): New method broken out from addURLImpl.
(JarURLLoader.JarURLLoader): Read mainfest to get "Class-Path"
attribute.
(JarURLLoader.getResource): Scan JARs in the "Class-Path".
I found an interesting bug in my solution. The "Class-Path" attribute
allows you to create circular dependencies, so you have to detect the
loop in order not to go into infinite recursion.
Does anoyone understand what other Java class libraries to do detect
such pathological cases? Somehow, even in a complex hierarchy of
class loaders it must be possible to detect the sitiation where one
delegates to another which delgates back to the first, etc, etc.