[kaffe] CVS kaffe (guilhem): Fixed class accessibility.

Guilhem Lavaux guilhem at kaffe.org
Thu Dec 22 05:39:28 PST 2005


Hi Ito,

I have met a new IllegalAccessError in eclipse. I have attached two 
files which reproduce the problem.

The protected bit is difficult to handle apparently. I have talked with 
Tom Tromey and it says that normally we should completely ignore the 
accessibility flag in inner classes.

Regards,

Guilhem.

Ito Kazumitsu wrote:

>From: Ito Kazumitsu <kaz at maczuka.gcd.org>
>Date: Thu, 22 Dec 2005 11:08:15 +0900 (JST)
>
>  
>
>>The runtime access control is much simpler than the compile-time
>>access control.  And we may be able to omit the checking of nested
>>relations of classes at runtime.
>>    
>>
>
>Simply omitting the checking of nested relations of classes
>causes IllegalAccessError, which was reported in November, 2003.
>
>I am afraid Sun's VM spec:
>
>  
>
>>A class or interface C is accessible to a class or interface D if and only if
>>either of the following conditions are true:
>>
>>(Runtime):
>>   - C is public.
>>   - C and D are members of the same runtime package.
>>    
>>
>
>is incomplete and something should be said about the case
>where C is protected.
>
>Attached below is my proposed patch.  I have deleted the
>checking of outer classes for determining slot_acc,
>but kept such checking for determining class_acc.
>
>With this patch applied,
>
>   - All the regression tests pass.
>   - Mauve test gnu.testlet.java.lang.Class.newInstance shows the
>     same results as Sun's JDK.
>   - The testcase attached to
>     http://www.kaffe.org/pipermail/kaffe/2003-November/096187.html
>     passes.
>  
>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: legal2.java
Type: text/x-java
Size: 141 bytes
Desc: not available
Url : http://kaffe.org/pipermail/kaffe/attachments/20051222/61c6d96f/attachment-0004.java 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: legal1.java
Type: text/x-java
Size: 156 bytes
Desc: not available
Url : http://kaffe.org/pipermail/kaffe/attachments/20051222/61c6d96f/attachment-0005.java 


More information about the kaffe mailing list