jdk/src/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java
changeset 24974 e4a51c336a52
parent 24685 215fa91e1b4c
child 25979 42e5d9f8087e
--- a/jdk/src/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java	Tue Jun 17 10:01:16 2014 +0200
+++ b/jdk/src/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java	Tue Jun 17 13:06:05 2014 +0400
@@ -40,6 +40,7 @@
 import static java.lang.invoke.MethodHandleNatives.Constants.*;
 import static java.lang.invoke.LambdaForm.BasicType.*;
 import sun.invoke.util.VerifyType;
+import sun.reflect.misc.ReflectUtil;
 
 /**
  * Code generation backend for LambdaForm.
@@ -594,6 +595,8 @@
             return false;  // inner class of some sort
         if (cls.getClassLoader() != MethodHandle.class.getClassLoader())
             return false;  // not on BCP
+        if (ReflectUtil.isVMAnonymousClass(cls)) // FIXME: switch to supported API once it is added
+            return false;
         MethodType mtype = member.getMethodOrFieldType();
         if (!isStaticallyNameable(mtype.returnType()))
             return false;
@@ -612,6 +615,8 @@
             cls = cls.getComponentType();
         if (cls.isPrimitive())
             return true;  // int[].class, for example
+        if (ReflectUtil.isVMAnonymousClass(cls)) // FIXME: switch to supported API once it is added
+            return false;
         // could use VerifyAccess.isClassAccessible but the following is a safe approximation
         if (cls.getClassLoader() != Object.class.getClassLoader())
             return false;