Chris Toshok wrote:
>
> > In Kaffe source, for exemple, the lookupClassEntry function (from
> > classMethod.c) make the comparison on the name _AND_ the class loader
> > (equalUtf8Consts(name, entry->name) && loader == entry->loader).
>
> If the classes are actually going to make it into the class repository,
> then a similar check to kaffe's should be used. they don't necessarily
> have to, though -- each ClazzFile* has a classloader slot - when
> resolving a class we could just call into its classloader (if it's set)
> and call find_class (if it's not.)
As I understood it (but ICBVW) this technique was dropped from Sun's JVM
due to security issues - a rogue classloader could break typesafety by
returning different results for the same class. As of JDK1.1, I think,
they guaranteed that the classloader would only be asked to resolve any
given class once.
I don't have any URLs or specs to back this up, I'm afraid, because it's
only a hazy memory. I hope someone who knows more than me will be able
to point to the relevant sources.
HTH,
Stuart.