Community
Participate
Working Groups
Tested on 3.2.0 M20060629-1905 <code> public class Shared { interface Moosh { void foo(); } static abstract class A implements Moosh {} static class X extends A {} static class Y extends A {} static class Z extends A {} public static void main(String[] args) { new X(); // throws ClassFormatError } } </code> The class X ends up having 3 copies of the auto-generated error-throwing method: static class SharedError$X extends SharedError$A { public void foo() { throw new Error("Unresolved compilation problem: \n\tThe type SharedError.Z must implement the inherited abstract method SharedError.Moosh.foo()\n"); } public void foo() { throw new Error("Unresolved compilation problem: \n\tThe type SharedError.Y must implement the inherited abstract method SharedError.Moosh.foo()\n"); } public void foo() { throw new Error("Unresolved compilation problem: \n\tThe type SharedError.X must implement the inherited abstract method SharedError.Moosh.foo()\n"); } }
Reproduced in R3_2_maintenance and HEAD stream
This problem should be located in the generation of problem type and problem method. I'll investigate.
When adding the problem methods for missing abstract methods, the problems were not filter to match the corresponding type declaration. This is why we ended up with 3 methods foo.
Fixed and released in HEAD. Released for 3.3M2. Added regression test org.eclipse.jdt.core.tests.compiler.regression.ProblemTypeAndMethodTest#test001
Verified for 3.3 M2 using build I20060918-0010.
Changing OS from Mac OS to Mac OS X as per bug 185991