PR java/14070: gij and -jar argument should set the manifest Class-path recursively

Tom Tromey tromey@redhat.com
Mon Nov 1 16:27:00 GMT 2004


>>>>> "Andrew" == Andrew Haley <aph@redhat.com> writes:

Andrew> Does anoyone understand what other Java class libraries to do detect
Andrew> such pathological cases?  Somehow, even in a complex hierarchy of
Andrew> class loaders it must be possible to detect the sitiation where one
Andrew> delegates to another which delgates back to the first, etc, etc.

The only way to get a class loader delegation loop is to write a
custom class loader that has its own delegation approach.  The
standard class loaders only delegate to their parent, and the parent
is set by the constructor and is private.

Eclipse 2 had a class loader that could potentially get into
delegation loops.  As I recall it solved this problem by having a flag
that was set so it could tell when a circular call occurred.

In the Class-Path case, it probably suffices to keep a set of all seen
URLs, then stop when you see one for a second time.  I think this will
work fine as all the action is taking place inside of a single
URLClassLoader.

Tom



More information about the Java-patches mailing list