Chris Gray <[EMAIL PROTECTED]> wrote on Fri, 19 Mar 2004 13:59:28 +0100:

>c.getClassLoader() returns the class loader which defined the class. Since 
>your CustomClassLoader quite properly uses the default loadClass() 
>implementation, Class c may be loaded by an ancestor. So your test needs to 
>match myClassLoader, but also the transitive closure of getParent().

Thanks, Chris. My mistake was that I thought Class.getClassLoader() would
return the initiating class loader, not the defining class loader. Since
there does not seem to exist an easy way to find the initiating loader,
I'll simply omit the two offending tests.

I've tried to call ClassLoader.findLoadedClass on the initiating loader,
but it contrast to what Sun's Javadoc says, it returns null both on the
JDK 1.4.1 and on JamVM.

Andrew Haley <[EMAIL PROTECTED]> wrote on Fri, 19 Mar 2004 11:19:27 +0000:

>I had a look, but it was rather hard to extract a test case from all
>this stuff.

Yes, the test might be a bit complicated. But I wouldn't see how to make
it much easier -- since its purpose is to test the full functionality.

-- Sascha

Sascha Brawer, [EMAIL PROTECTED], http://www.dandelis.ch/people/brawer/ 




_______________________________________________
Classpath mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/classpath

Reply via email to