Community
Participate
Working Groups
The following code should report an error: public enum X { A ; public abstract void foo(); }
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