Bug 78015 - [1.5][compiler] AbstractMethodError
Summary: [1.5][compiler] AbstractMethodError
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 critical (vote)
Target Milestone: 3.1 M4   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-11-06 08:10 EST by Michael Forster CLA
Modified: 2004-12-14 15:45 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Forster CLA 2004-11-06 08:10:15 EST
The following code


interface I<T> {
    void m1(T t);
    void m2(T t);
}

class A {};

class B implements I<A> {
    public void m1(A a) {}
    public void m2(A a) {}
}

public class Main {
    public static void main(String[] args) {
        m(new B());
    }

    public static void m(I<A> x) {
        x.m1(null);
    }
}


throws this exception:


Exception in thread "main" java.lang.AbstractMethodError: B.m1
(Ljava/lang/Object;)V
	at Main.m(Main.java:19)
	at Main.main(Main.java:15)


when compiled and run with Eclipse 3.1M3. The exception does not occur when 
the code is compiled with the Sun JDK 1.5 Compiler. It does also not occur, 
when x.m1(null); is replaced with x.m2(null); or if m2 is removed.
Comment 1 Philipe Mulet CLA 2004-11-10 11:40:29 EST
We are not generating a bridge method for #m1(Object) on B
Comment 2 Philipe Mulet CLA 2004-11-10 12:52:58 EST
Recording of bridge methods did not consider selector match when looking for
duplicates.
Added regression test: GenericTypeTest#test411.
Fixed
Comment 3 Olivier Thomann CLA 2004-12-14 15:45:12 EST
Verified in 200412140800