Summary: | [1.5][compiler] abstract methods in an enum declaration must be implemented for each constant | ||
---|---|---|---|
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: | jp.fielding |
Version: | 3.1 | ||
Target Milestone: | 3.1 M4 | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Whiteboard: |
Description
Olivier Thomann
2004-11-17 23:47:20 EST
We report an error, but not the right error. We report: ---------- 1. ERROR in C:\tests_sources\X.java (at line 5) public abstract void foo(); ^^^^^ The abstract method foo in type X can only be defined by an abstract class ---------- 1 problem (1 error) Javac reports: X.java:1: X is not abstract and does not override abstract method foo() in X public enum X { ^ 1 error Indeed, the following should be accepted: public enum X { A () { public void foo() {} } ; public abstract void foo(); } Support added. Also tagged enum classfile as abstract when defining abstract methods (implicit). Added regression tests: EnumTest#test052-055. Fixed *** Bug 77211 has been marked as a duplicate of this bug. *** Verified in 200412140800 |