jdk/src/java.base/share/classes/sun/invoke/util/VerifyAccess.java
changeset 44591 b9bf065070fe
parent 43712 5dfd0950317c
child 44599 942f3546b679
--- a/jdk/src/java.base/share/classes/sun/invoke/util/VerifyAccess.java	Tue Apr 11 11:24:12 2017 +0200
+++ b/jdk/src/java.base/share/classes/sun/invoke/util/VerifyAccess.java	Tue Apr 11 18:57:46 2017 +0200
@@ -297,10 +297,13 @@
      * @param refc the class attempting to make the reference
      */
     public static boolean isTypeVisible(java.lang.invoke.MethodType type, Class<?> refc) {
-        for (int n = -1, max = type.parameterCount(); n < max; n++) {
-            Class<?> ptype = (n < 0 ? type.returnType() : type.parameterType(n));
-            if (!isTypeVisible(ptype, refc))
+        if (!isTypeVisible(type.returnType(), refc)) {
+            return false;
+        }
+        for (int n = 0, max = type.parameterCount(); n < max; n++) {
+            if (!isTypeVisible(type.parameterType(n), refc)) {
                 return false;
+            }
         }
         return true;
     }