This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Sun's java vs. gij : Own classloader and static attributes


>>>>> "Stefan" == Stefan Prelle <prelle@informatik.uni-bremen.de> writes:

Stefan> [ Sun's java ]
Stefan> In Loaded: Value is 0

Hmm, I don't see this with 1.4.2:

fleche. /usr/java/j2sdk1.4.2/bin/java Test
Value is 5
In Loaded: Value is 5
In Loaded: Classloader is sun.misc.Launcher$AppClassLoader@136228


... nor would I expect to.
I would expect the base `MyStatic' to be found by `MyClassLoader' due
to class loader delegation.


Oh, I just saw the bit about changing the name from loadClass to
findClass.  This is interesting, perhaps we aren't supposed to have
loadClass(String) call loadClass(String,boolean).  Perhaps for legacy
applications we should instead do calls in the other order, and put
the logic in loadClass(String).  That would let us duplicate Sun's
behavior here.  The docs are a bit vague about this.

Meanwhile, you aren't supposed to override ClassLoader.loadClass.
Instead, as you discovered, you are supposed to override findClass.

Tom


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]