Project: JDT
Bug 200016 [1.5][compiler] better error message when enum constants must implement methods
Reported: 2007-08-15 06:36:08 | Status: verified fixed

3.4 In the following code, the enum constants need to implement 'foo'. Currently the error is on 'foo': 'The enum TestEnum can only define the abstract method foo() if it also defines enum constants with corresponding implementations' enum TestEnum { test1, test2; public abstract boolean foo(); } I think it would make more sense to report this on the constants directly, like it is done for types that need to implement methods: 'The enum constant test1 must implement the abstract method foo()'. Especially if some constants implement 'foo' already it would be more natural to get the error on the constant (also better for the quick fix)

Files changed in fix:
org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/LocalCorrectionsQuickFixTest.java org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/ModifierCorrectionsQuickFixTest.java org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/StubUtility2.java org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/AddUnimplementedMethodsOperation.java org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/UnimplementedCodeFix.java org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/fix/UnimplementedCodeCleanUp.java org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/ModifierCorrectionSubProcessor.java org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/QuickFixProcessor.java