jdk/src/share/classes/java/lang/invoke/DirectMethodHandle.java
changeset 16119 ca09c1ad6a45
parent 14342 8435a30053c1
child 16123 82033940e774
--- a/jdk/src/share/classes/java/lang/invoke/DirectMethodHandle.java	Fri Feb 22 03:00:48 2013 -0800
+++ b/jdk/src/share/classes/java/lang/invoke/DirectMethodHandle.java	Fri Feb 22 03:00:12 2013 -0800
@@ -51,6 +51,16 @@
     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;
     }