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: null ClassLoader


At 09:05 AM 12/20/01 +0200, Torsten Rüger wrote:
>Tom Tromey wrote:
>
>>One simple fix would be to simply always set the loader field when
>>registering a class.  The reality is that all classes in shared
>>libraries which are linked into the application *are* loaded by our
>>"bootstrap" loader.
>
>
>That sounds good...


excuse the intrusion but, at the risk of stating the obvious, i just want 
to attract people (who are working on this)'s attention to the fact that 
classloaders are also used to partition the name space.  for example i 
might write an application that loads a class with the same name, but with 
different behaviour, from two different jars, each with a distinct 
classloader.  i should then be able to get two distinct instances of the 
same class.

if as it sounds to me, all classes are loaded by the same classloader, and 
in the example above, the second class instance (supposedly from the second 
jar) will not get loaded/created which is contrary to the semantics of the 
classloader.


cheers;
rsn


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