[kaffe] java.lang.IllegalAccessError
Guilhem Lavaux
guilhem@kaffe.org
Sat Oct 25 08:07:01 2003
Helmer Kr=E4mer wrote:
>On Fri, 24 Oct 2003 20:14:38 +0200
>Guilhem Lavaux <guilhem@kaffe.org> wrote:
>
>Hi Guilhem, hi Ito,
>=20
> =20
>
>>>The attached programs cause java.lang.IllegalAccessError,
>>>which partly seemes to have something to do with KJC,
>>>but class files compiled with Sun's javac also cause the
>>>error.
>>>
>>> =20
>>>
>>Apparently KJC choses to protect the inner class (as usual). I've not=20
>>really seen a specific restriction about access modifiers concerning=20
>>inner classes in doc but the JDK's compiler put your sample class in=20
>>public access (even though you explicitly specified it protected). The=20
>>best guess I can make is to ignore the access modifier for inner classe=
s=20
>>in KJC. I'll prepare this for tomorrow.
>> =20
>>
>
>I don't think that this would be the correct fix (altering
>the access modifiers during compilation doesn't look right
>to me). For a discussion of a similar problem have a look
>at the thread starting at this mail:
>=20
>http://groups.google.com/groups?hl=3Den&lr=3D&ie=3DUTF-8&selm=3DPine.LNX=
.4.10.10010111327040.12800-100000%40green.usr.onet
>
>I think the real problem is kaffe's runtime access checking,
>which is why I'm about to check in the following patch:
> =20
>
Yes, but this doesn't solve the problem concerning JDK. If you=20
disassemble the code generated
from the classes provided by Ito you may notice that the inner class=20
doesn't have any protection
although it is protected. But I've made another test with private and=20
apparently it changes something also
concerning the modifier, so the problem should be more complicated.
Cheers,
Guilhem.