8006125: Update MethodHandles library interactions
authorvlivanov
Fri, 22 Feb 2013 02:59:24 -0800
changeset 16120 133a029f510a
parent 16119 ca09c1ad6a45
child 16121 49db59536470
8006125: Update MethodHandles library interactions Reviewed-by: jrose
jdk/src/share/classes/sun/reflect/misc/MethodUtil.java
--- a/jdk/src/share/classes/sun/reflect/misc/MethodUtil.java	Fri Feb 22 03:00:12 2013 -0800
+++ b/jdk/src/share/classes/sun/reflect/misc/MethodUtil.java	Fri Feb 22 02:59:24 2013 -0800
@@ -252,6 +252,12 @@
     public static Object invoke(Method m, Object obj, Object[] params)
         throws InvocationTargetException, IllegalAccessException {
         if (m.getDeclaringClass().equals(AccessController.class) ||
+           (m.getDeclaringClass().equals(java.lang.invoke.MethodHandles.class)
+            && m.getName().equals("lookup")) ||
+           (m.getDeclaringClass().equals(java.lang.invoke.MethodHandles.Lookup.class)
+            && (m.getName().startsWith("find") ||
+                m.getName().startsWith("bind") ||
+                m.getName().startsWith("unreflect"))) ||
             m.getDeclaringClass().equals(Method.class))
             throw new InvocationTargetException(
                 new UnsupportedOperationException("invocation not supported"));