[kaffe] java.lang.IllegalAccessError

Ito Kazumitsu kaz at maczuka.gcd.org
Sun Oct 26 14:42:02 PST 2003


>>>>> ":" == Helmer Krämer <hkraemer at freenet.de> writes:

>> Apparently KJC choses to protect the inner class (as usual). I've not 
>> really seen a specific restriction about access modifiers concerning 
>> inner classes in doc but the JDK's compiler put your sample class in 
>> public access (even though you explicitly specified it protected). The 
>> best guess I can make is to ignore the access modifier for inner classes 
>> in KJC. I'll prepare this for tomorrow.

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

:> I think the real problem is kaffe's runtime access checking,
:> which is why I'm about to check in the following patch:

Thanks to your patch,  my test case now gives the following results:

Compiler       Runtime VM       Result
--------       ----------       -------------------------
KJC            Kaffe            OK
               JDK              OK
               JDK -verify      java.lang.IllegalAccessError

javac of JDK   Kaffe            OK
               JDK              OK
               JDK -verify      OK

So in the kaffe world this issue has been settled, but if
we want KJC to be compatible with Sun's javac, Guilhem's
work is waited for.

Cases similar to my test case is appearing in some important
applications such as JExcelAPI and HSQLDB.

More information about the kaffe mailing list