Community
Participate
Working Groups
The jdt compiler raises an error for a legal (JLS-conform) Java program: Code to reproduce error: ------------- A.java --------------- package p1; public class A { void m() {} } ------------- B.java --------------- package p2; public class B extends p1.A { void m() {} } ------------- C.java --------------- package p1; public class C extends p2.B { @Override void m() {} } This gives the following error: 1. ERROR in p1/C.java (at line 4) @Override void m() {} ^^^ The method m() of type C must override or implement a supertype method According to the JLS(3) sections 8.4.8.1 and 8.4.8.3, the method m in C overrides the method m in A. The javac (1.6.0_07) compiler does not raise an error and is in this respect spec-conform.
Created attachment 131026 [details] Proposed patch and testcase
Fix and test released for 3.5M7
Verified for 3.5M7 using build I20090426-2000