@Override annotation and interfaces
Intellij 6.0.5 (6180) on Ubuntu, Java 1.6.0_02. IDEA reports in the About dialog that this JDK instance is in use.
I have a class which implements an interface. A method declared in the interface and implemented in the class is marked with @Override, and IDEA reports the following error
"Method does not override method from its superclass"
The same code compiles cleanly with Java 6.
public interface FooInterface {
void foo();
}
public class FooImpl implements FooInterface {
@Override
public void foo() {
System.out.println("foo");
}
}
I can't find an inspection for this message, so I guess it comes from a built-in parser.
How can I avoid this message? We are going with the Java 6 compiler implementation, which says the override annotation is correct.
TIA
Patrick
请先登录再写评论。
Please try the IDEA 6.0.6 EAP. Should be fixed there.
--
regards,
--
Alexey Kudravtsev
Software Developer
JetBrains, Inc, http://www.jetbrains.com
"Develop with pleasure!"
"Patrick Wright" <no_reply@jetbrains.com> wrote in message
news:16841164.1185788544218.JavaMail.itn@is.intellij.net...
>
>
>
>
>
>
>
>
Confirmed this works in build 6189. Many thanks!