From: Ito Kazumitsu <[EMAIL PROTECTED]> Date: Sun, 11 Dec 2005 10:51:52 +0900 (JST)
> The next test case will illustrate this problem more clearly. > > $ cat A.java > public class A { > public static void main(String[] args) { > try { > B.getPrivateClass().newInstance(); > } > catch (Exception e) { > e.printStackTrace(); > } > } > > } > $ cat B.java > public class B { > private static class PrivateClass {} > public static Class getPrivateClass() { return PrivateClass.class; } > } > > In this case, Sun's JDK throws IllegalAccessException as expected. > But Kaffe does not. kaffe/kaffevm/access.c has this code: 261 else if( same_package && !(target_flags & ACC_PRIVATE) ) 262 { 263 /* Package. */ 264 slot_acc = 1; 265 } I am afraid this makes anything private in the target class T accessible to the caller C if T and C are in the same package and T is accessible to C. _______________________________________________ kaffe mailing list kaffe@kaffe.org http://kaffe.org/cgi-bin/mailman/listinfo/kaffe