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

Guilhem Lavaux guilhem at kaffe.org
Thu Dec 22 06:01:22 PST 2005


Hi Ito,

Here is a better example. The previous could not be compiled directly if 
you try to compile indepedently then you'll see the runtime accepts it.
Here I have an example which compiles and should run on a VM. However 
kaffe throws an IllegalAccessError.

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: legal1.java
Type: text/x-java
Size: 156 bytes
Desc: not available
Url : http://kaffe.org/pipermail/kaffe/attachments/20051222/5aa9cdea/attachment-0004.java 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: legal2.java
Type: text/x-java
Size: 281 bytes
Desc: not available
Url : http://kaffe.org/pipermail/kaffe/attachments/20051222/5aa9cdea/attachment-0005.java 


More information about the kaffe mailing list