src/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File
jdk Cdiff src/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java
src/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java
Print this page
rev 10086 : 8046903: VM anonymous class members can't be statically invocable
Reviewed-by: ?
*** 38,47 ****
--- 38,48 ----
import java.lang.reflect.*;
import static java.lang.invoke.MethodHandleStatics.*;
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.
* <p>
* @author John Rose, JSR 292 EG
*** 592,601 ****
--- 593,604 ----
return false; // FIXME
if (cls.isAnonymousClass() || cls.isLocalClass())
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;
for (Class<?> ptype : mtype.parameterArray())
if (!isStaticallyNameable(ptype))
*** 610,619 ****
--- 613,624 ----
static boolean isStaticallyNameable(Class<?> cls) {
while (cls.isArray())
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;
if (VerifyAccess.isSamePackage(MethodHandle.class, cls))
return true;
src/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File