-
Bug
-
Resolution: Fixed
-
P3
-
9
-
None
-
b22
Use MHs.lookup to look itself up. The resulting MH is broken. See attached test case, or the following snippet:
Lookup lookup = lookup();
lookup.findStatic(lookup.lookupClass(), "say", methodType(void.class, String.class)).invokeExact("hello, world");
MethodHandle MH_lookup2 = lookup.findStatic(MethodHandles.class, "lookup", methodType(Lookup.class));
// Next line gets IAE: illegal lookupClass: class java.lang.invoke.MethodHandleImpl$BindCaller$T/471910020
Lookup lookup2 = (Lookup) MH_lookup2.invokeExact();
Suggested fix: Special-case the caller binding logic for lookup.
Consider doing this for any other hyper-sensitive @CallerSensitive method which looks at more than its caller class loader.
Lookup lookup = lookup();
lookup.findStatic(lookup.lookupClass(), "say", methodType(void.class, String.class)).invokeExact("hello, world");
MethodHandle MH_lookup2 = lookup.findStatic(MethodHandles.class, "lookup", methodType(Lookup.class));
// Next line gets IAE: illegal lookupClass: class java.lang.invoke.MethodHandleImpl$BindCaller$T/471910020
Lookup lookup2 = (Lookup) MH_lookup2.invokeExact();
Suggested fix: Special-case the caller binding logic for lookup.
Consider doing this for any other hyper-sensitive @CallerSensitive method which looks at more than its caller class loader.
- blocks
-
JDK-8257874 MethodHandle injected invoker doesn't have necessary private access
-
- Closed
-
- relates to
-
JDK-8207834 Calling MethodHandleProxies.aII via MethodHandle throws InternalError
-
- Open
-
-
JDK-8271820 Implementation of JEP 416: Reimplement Core Reflection with Method Handle
-
- Resolved
-
(1 links to)