-
Bug
-
Resolution: Duplicate
-
P4
-
hs23, hs24, 7
-
x86
-
linux
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8019017 | 7u45 | John Rose | P4 | Closed | Fixed | b01 |
JDK-8003094 | 7u40 | John Rose | P4 | Closed | Fixed | b01 |
interface A {
Iterable m(List<String> ls);
}
interface B {
Iterable<String> m(List l);
}
interface AB extends A, B { }
interface AA extends A { }
If I do:
MethodHandle mh1 = MethodHandles.lookup().findVirtual(A.class, "m", MethodType.methodType(Iterable.class, List.class));
MethodHandle mh2 = MethodHandles.lookup().findVirtual(B.class, "m", MethodType.methodType(Iterable.class, List.class));
MethodHandle mh3 = MethodHandles.lookup().findVirtual(AB.class, "m", MethodType.methodType(Iterable.class, List.class));
MethodHandle mh4 = MethodHandles.lookup().findVirtual(AA.class, "m", MethodType.methodType(Iterable.class, List.class));
I would expect all the lookups to succeed. However, only lookups for A, B, and AA succeed; lookups for AB fail with
java.lang.NoSuchMethodException: no such method: AB.m(List)Iterable
It fails the same way when the generics are removed. So it appears to be a problem with an interface multiply inheriting the same method and not overriding it.
- backported by
-
JDK-8003094 MethodHandles.Lookup.findVirtual is confused by interface methods that are multiply inherited
- Closed
-
JDK-8003095 MethodHandles.Lookup.findVirtual is confused by interface methods that are multiply inherited
- Closed
-
JDK-8019017 MethodHandles.Lookup.findVirtual is confused by interface methods that are multiply inherited
- Closed
- blocks
-
JDK-8009129 Illegal access error when calling method reference
- Closed
- duplicates
-
JDK-8014013 CallInfo structure no longer accurately reports the result of a LinkResolver operation
- Resolved
- relates to
-
JDK-8014013 CallInfo structure no longer accurately reports the result of a LinkResolver operation
- Resolved
-
JDK-8000999 backport of JSR 292 to 7u
- Closed
-
JDK-7157574 method handles returned by reflective lookup API sometimes have wrong receiver type
- Closed
-
JDK-7191363 JSR 292 regression: problem described in 7087658 is unresolved
- Closed