Summary: | [1.5][compiler] Misleading error message for static methods with @Override annotation | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Christoph Nievergelt <nievi> |
Component: | Core | Assignee: | Philipe Mulet <philippe_mulet> |
Status: | RESOLVED WONTFIX | QA Contact: | |
Severity: | enhancement | ||
Priority: | P3 | CC: | david_audel |
Version: | 3.2.1 | ||
Target Milestone: | 3.4 RC1 | ||
Hardware: | All | ||
OS: | All | ||
Whiteboard: |
Description
Christoph Nievergelt
2007-06-15 04:29:22 EDT
On following: class Base { public static void foo() {} public void bar() {} } public class X extends Base { public static void foo() {} public void bar() {} } Neither javac6 or javac7 will report missing@Override annotation. Neither do we in 3.4M7. I agree our error message needs to be read twice to figure, but essentially it tells the truth in saying that X#foo() does not override Base#foo() (since static methods do not override). I think our current message is tolerable. And yes javac6 and javac7 also report this issue. Verified for 3.4RC1. My complaint was about the following situation: class Base { public static void xYzzy() {} } public class X extends Base { @Override public static void xYzzy() {} } In this situation, the message simply does not make sense. Sorry for the unclear bug report; I should have included an example when I reported. In theory you could imagine nuancing the error message, but in practice the way it reads today is not wrong; I guess it depends whether you think 'static' is a stronger statement than '@Overrides'. I wouldn't change the message for such a small nuance. Closing again. |