提交 eb70c8a0 编写于 作者: V vlivanov

8006179: JSR292 MethodHandles lookup with interface using findVirtual()

Reviewed-by: jrose, twisti
上级 e3e92002
......@@ -51,6 +51,16 @@ class DirectMethodHandle extends MethodHandle {
private DirectMethodHandle(MethodType mtype, LambdaForm form, MemberName member) {
super(mtype, form);
if (!member.isResolved()) throw new InternalError();
if (member.getDeclaringClass().isInterface() && !member.isAbstract()) {
// Check for corner case: invokeinterface of Object method
MemberName m = new MemberName(Object.class, member.getName(), member.getMethodType(), member.getReferenceKind());
m = MemberName.getFactory().resolveOrNull(m.getReferenceKind(), m, null);
if (m != null && m.isPublic()) {
member = m;
}
}
this.member = member;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册