# HG changeset patch # User jrose # Date 1357955621 28800 # Node ID d9969a953f693f5760b1d2759f11a2cb222e4f20 # Parent f9567d889266689d5b76f11a23584127848700bc 8006125: Update MethodHandles library interactions Reviewed-by: mchung, jdn, ahgross --- a/src/share/classes/java/lang/invoke/MethodHandles.java Fri Jan 11 09:00:00 2013 -0800 +++ b/src/share/classes/java/lang/invoke/MethodHandles.java Fri Jan 11 17:53:41 2013 -0800 @@ -68,10 +68,6 @@ public class MethodHandles { */ public static Lookup lookup() { return new Lookup(); - } - static { - // FIXME in MR1: Core Reflection cannot be used to gain a Lookup to perform MH reflection - Reflection.registerMethodsToFilter(MethodHandles.class, "lookup"); } /** --- a/src/share/classes/sun/reflect/misc/MethodUtil.java Fri Jan 11 09:00:00 2013 -0800 +++ b/src/share/classes/sun/reflect/misc/MethodUtil.java Fri Jan 11 17:53:41 2013 -0800 @@ -256,6 +256,12 @@ public final class MethodUtil extends Se 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"));