logo       
Google Custom Search
    AddThis Social Bookmark Button

Nice/src/gnu/bytecode Access.java,1.7,1.8: msg#00008

Subject: Nice/src/gnu/bytecode Access.java,1.7,1.8
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;      
+   }
  }



-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click



Try Searching:
servers, voip, java, networking, microsoft ...
<Prev in Thread] Current Thread [Next in Thread>