8298177: Various java.lang.invoke cleanups

8284363: Redundant imports in BoundMethodHandle

Reviewed-by: jvernee
This commit is contained in:
Claes Redestad 2022-12-07 15:37:58 +00:00
parent 6ed36835ec
commit 3de775094d
11 changed files with 80 additions and 375 deletions

View file

@ -1005,7 +1005,8 @@ abstract class MethodHandleImpl {
}
static MethodHandle fakeVarHandleInvoke(MemberName method) {
// TODO caching, is it necessary?
MethodType type = MethodType.methodType(method.getReturnType(), UnsupportedOperationException.class,
MethodType type = MethodType.methodType(method.getMethodType().returnType(),
UnsupportedOperationException.class,
VarHandle.class, Object[].class);
MethodHandle mh = throwException(type);
mh = mh.bindTo(new UnsupportedOperationException("cannot reflectively invoke VarHandle"));