Community
Participate
Working Groups
The following code generate an AbstractMethodError at runtime : ---------------------------------------------------------------- import java.util.List; public interface I<T> { List<T> f(T t); } ---------------------------------------------------------------- import java.util.List; public abstract class A<N extends A.NImpl> implements I<N> { public List<N> f(NImpl n) { // <--- oh oh, little trick return null; } static class NImpl { } } ------------------------------------------------------------ public class B extends A<A.NImpl> { } ------------------------------------------------------------ import java.util.List; public class Test { public static <T> List<T> f(I<T> i,T t) { return i.f(t); } public static void main(String[] args) { I<?> i=new B(); i.f(null); } } at runtime : Exception in thread "main" java.lang.AbstractMethodError: bug2.B.f(Ljava/lang/Object;)Ljava/util/List; at bug2.Test.main(Test.java:11) the bridge b.f() in not generated by eclipse compiler. Rémi Forax
Our comparison of the member type in public List<N> f(NImpl n) {...} to the substituted type in I.f(T) is causing the problem.
Added MethodVerifyTest 84 The issue with bridge methods was a side affect of the fact that we incorrectly compared the method parameters of A.f(NImpl) with I.f(T), which was substituted with the member type NImpl.
Verified for 3.2RC1 with build I20060413-1718