[kaffe] CVS kaffe (guilhem): Fixed class accessibility.
guilhem at kaffe.org
Thu Dec 22 01:05:42 PST 2005
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:
>> - 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
Thanks for spending some more time in access.c. My previous patch was
minimalist. But if this one passes everything it's great and please
apply it to CVS ! I think we should add a regression test for this
feature also. I will do it before release if you do not.
More information about the kaffe