1.1 --- a/rt/emul/compact/src/main/java/java/lang/invoke/MethodHandleImpl.java Sat Aug 09 11:11:13 2014 +0200
1.2 +++ b/rt/emul/compact/src/main/java/java/lang/invoke/MethodHandleImpl.java Sun Aug 10 06:13:36 2014 +0200
1.3 @@ -34,8 +34,6 @@
1.4 import sun.invoke.util.ValueConversions;
1.5 import sun.invoke.util.VerifyType;
1.6 import sun.invoke.util.Wrapper;
1.7 -import sun.reflect.CallerSensitive;
1.8 -import sun.reflect.Reflection;
1.9 import static java.lang.invoke.LambdaForm.*;
1.10 import static java.lang.invoke.MethodHandleStatics.*;
1.11 import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
1.12 @@ -842,6 +840,8 @@
1.13 }
1.14
1.15 private static MethodHandle makeInjectedInvoker(Class<?> hostClass) {
1.16 + throw new IllegalStateException("Implement me too!");
1.17 + /*
1.18 Class<?> bcc = UNSAFE.defineAnonymousClass(hostClass, T_BYTES, null);
1.19 if (hostClass.getClassLoader() != bcc.getClassLoader())
1.20 throw new InternalError(hostClass.getName()+" (CL)");
1.21 @@ -873,6 +873,7 @@
1.22 throw new InternalError(ex);
1.23 }
1.24 return bccInvoker;
1.25 + */
1.26 }
1.27 private static ClassValue<MethodHandle> CV_makeInjectedInvoker = new ClassValue<MethodHandle>() {
1.28 @Override protected MethodHandle computeValue(Class<?> hostClass) {
1.29 @@ -905,7 +906,7 @@
1.30 private static final MethodHandle MH_checkCallerClass;
1.31 static {
1.32 final Class<?> THIS_CLASS = BindCaller.class;
1.33 - assert(checkCallerClass(THIS_CLASS, THIS_CLASS));
1.34 +// assert(checkCallerClass(THIS_CLASS, THIS_CLASS));
1.35 try {
1.36 MH_checkCallerClass = IMPL_LOOKUP
1.37 .findStatic(THIS_CLASS, "checkCallerClass",
1.38 @@ -916,16 +917,16 @@
1.39 }
1.40 }
1.41
1.42 - @CallerSensitive
1.43 - private static boolean checkCallerClass(Class<?> expected, Class<?> expected2) {
1.44 - // This method is called via MH_checkCallerClass and so it's
1.45 - // correct to ask for the immediate caller here.
1.46 - Class<?> actual = Reflection.getCallerClass();
1.47 - if (actual != expected && actual != expected2)
1.48 - throw new InternalError("found "+actual.getName()+", expected "+expected.getName()
1.49 - +(expected == expected2 ? "" : ", or else "+expected2.getName()));
1.50 - return true;
1.51 - }
1.52 +// @CallerSensitive
1.53 +// private static boolean checkCallerClass(Class<?> expected, Class<?> expected2) {
1.54 +// // This method is called via MH_checkCallerClass and so it's
1.55 +// // correct to ask for the immediate caller here.
1.56 +// Class<?> actual = Reflection.getCallerClass();
1.57 +// if (actual != expected && actual != expected2)
1.58 +// throw new InternalError("found "+actual.getName()+", expected "+expected.getName()
1.59 +// +(expected == expected2 ? "" : ", or else "+expected2.getName()));
1.60 +// return true;
1.61 +// }
1.62
1.63 private static final byte[] T_BYTES;
1.64 static {