jdk/src/java.base/share/classes/sun/invoke/util/VerifyAccess.java
changeset 44591 b9bf065070fe
parent 43712 5dfd0950317c
child 44599 942f3546b679
equal deleted inserted replaced
44590:15a77e5b7612 44591:b9bf065070fe
   295      * reference of a given reference class, is really visible to that class.
   295      * reference of a given reference class, is really visible to that class.
   296      * @param type the supposed type of a member or symbolic reference of refc
   296      * @param type the supposed type of a member or symbolic reference of refc
   297      * @param refc the class attempting to make the reference
   297      * @param refc the class attempting to make the reference
   298      */
   298      */
   299     public static boolean isTypeVisible(java.lang.invoke.MethodType type, Class<?> refc) {
   299     public static boolean isTypeVisible(java.lang.invoke.MethodType type, Class<?> refc) {
   300         for (int n = -1, max = type.parameterCount(); n < max; n++) {
   300         if (!isTypeVisible(type.returnType(), refc)) {
   301             Class<?> ptype = (n < 0 ? type.returnType() : type.parameterType(n));
   301             return false;
   302             if (!isTypeVisible(ptype, refc))
   302         }
       
   303         for (int n = 0, max = type.parameterCount(); n < max; n++) {
       
   304             if (!isTypeVisible(type.parameterType(n), refc)) {
   303                 return false;
   305                 return false;
       
   306             }
   304         }
   307         }
   305         return true;
   308         return true;
   306     }
   309     }
   307 
   310 
   308     /**
   311     /**