Summary: | [1.5][compiler] @Override cannot be used for static methods | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Olivier Thomann <Olivier_Thomann> |
Component: | Core | Assignee: | Philipe Mulet <philippe_mulet> |
Status: | VERIFIED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | CC: | daniel_megert, jeffmcaffer, Mike_Wilson |
Version: | 3.2 | ||
Target Milestone: | 3.2 M6 | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Whiteboard: |
Description
Olivier Thomann
2006-03-01 14:30:51 EST
Static methods should get complained indeed. Introduced a new problem constant ID: IProblem#StaticMethodOverride This is not a breaking API change, just an additional compiler diagnostic which we were missing incorrectly. Mike/Jeff - slight API change, but still technically an API change. Can you pls cast your vote ? In the past, we did let new compiler IDs to make it until late in the game. Mostly JDT/UI is the only consumer for these so as to compute quickfixes (for a subset of them). cc'ing jeff Can now tell: public static void foo() {} ^^^^^ The method foo() of type Derived cannot be tagged with @Override since it is static Hmm... actually, only saying: The method foo() of type Derived must override a superclass method wouldn't require any API change at all. Message is not as intuitive, though overriding only occurs in between instance methods; thus it is still accurate. No need to worry Mike/Jeff. No more API change. Fixed in HEAD. Added AnnotationTest#test194. Verified for 3.2 M6 using build I20060328-0010 Could the message be improved for 3.3? See also thread "Problem with annotation" on eclipse.newcomer. |