This is the mail archive of the kawa@sources.redhat.com mailing list for the Kawa project.


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

Re: about ClassLoaders


>>> Chris <chris@tech.com.au> 11-Apr-01 9:58:42 AM >>>

>I notice that if you try and redefine a class with a 
>ClassLoader, Java throws an error, but if you
>create a new ClassLoader, Java will let  the new 
>ClassLoader recreate the Class. Has anybody
>got any insights about why this should be so?

This is standard Java. You can do this whether a class loader has the
original as a parent or not (but if it does have the original as a
parent you have to break the 1.2 CL pattern).

>Also, I see that if you declare a Foo class in your code, 
>and then manually load a Foo class with a custom 
>ClassLoader, Java won't  recognise them as being the same 
>class. 

It will if you give your custom cl the kawa cl as it's parent. The
Kawa cl is (presumably) the System cl.


>Has anybody got any insights about these murky matters?

Class loading is quite a dark issue, but information is out there.
The advanced-java list at egorups (now yahoo) has had many
conversations about this.


Nic Ferrier


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