Community
Participate
Working Groups
If a class overides an abstract method from a super and this method is annotated with an @Override tag, the jdt does not recognize the method as an override and flags an error. E.g.: public abstract class Foo { abstract protected boolean accept(Object o); } public class Bar extends Foo { @Override protected boolean accept(Object o) { return false; } } Since accpet(...) in Foo as well as in Bar have the same signature (see http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html#38649) accept in Foo does really override accpet in Bar (see http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html#227927). So the given example is correct and should compile without errors (as with Sun's javac). I marked it as blocker, since due to this bug jdt cannot be used in our projects, anymore :(
Ooops - forgot to mention the version: Version: 3.1.0 Build id: 200412081200 Bug was probably introduced after 3.1.0M3
As a workaround, you may comment out the @Override annotation for now. Problem comes from the fact we consider it to implement and not override, which for the semantics of @Override should not be distinguished. Note that we can distinguish in between interface/abstract method implementations and superclass method override.
Problem comes from the fact we are considering method as implementing abstract method and not overriding it (as for interface methods).
Added: AnnotationTest#test100. Fixed
fixed
Verified in 200412160010