Bug: LoadClass ("[B") etc doesn't work

Tom Tromey tromey@redhat.com
Mon Apr 4 18:21:00 GMT 2005


>>>>> "Andrew" == Andrew Haley <aph@redhat.com> writes:

Andrew> This is a fairly evil hack that seems to fix things.

I thought perhaps this should go in VMClassLoader.loadClass, but I
think that fails since we don't know the proper class loader for the
array at that point.

ClassLoader.loadClassFromSig should just call
_Jv_FindClassFromSignature.  And, it shouldn't bother with the
'resolve' argument at all -- leave resolution to loadClass() itself.
(I'm checking in a small patch from Classpath that restructures
loadClass to make this more obvious.)


Hmm, _Jv_FindClassFromSignature won't do the right thing for certain
malformed signatures, like "[Lfoo".  It should probably throw an error
rather than return NULL.  It could also iterate rather than recurse,
just as a micro-optimization.  I'm going to file this in bugzilla.

Tom



More information about the Java mailing list