[Nice-commit] Nice/src/gnu/bytecode Access.java,1.7,1.8
Brought to you by:
bonniot
From: Arjan B. <ar...@us...> - 2004-11-06 11:23:24
|
Update of /cvsroot/nice/Nice/src/gnu/bytecode In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24364/F:/nice/src/gnu/bytecode Modified Files: Access.java Log Message: Check whether a class being extended is visible and make Nice classes public by default. (patch by Luc Perrin) Index: Access.java =================================================================== RCS file: /cvsroot/nice/Nice/src/gnu/bytecode/Access.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Access.java 20 Sep 2004 10:24:41 -0000 1.7 --- Access.java 6 Nov 2004 11:23:08 -0000 1.8 *************** *** 76,78 **** --- 76,97 ---- c.isSubclass(target) && receiver.isSubtype(c); } + + /*** + * Returns true if classType is legally accessible in the given package. + */ + public static boolean legal(ClassType classType, String packageName) + { + int mod = classType.getModifiers(); + + if ((mod & PUBLIC) != 0) + return true; + + if ((mod & PRIVATE ) != 0) + return false; + + if (! packageName.equals(classType.getPackageName())) + return false; + + return true; + } } |