classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ServiceFactory


From: Sascha Brawer
Subject: Re: ServiceFactory
Date: Fri, 19 Mar 2004 15:32:22 +0100

Chris Gray <address@hidden> 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 <address@hidden> 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, address@hidden, http://www.dandelis.ch/people/brawer/ 






reply via email to

[Prev in Thread] Current Thread [Next in Thread]