Summary: | ACC_ABSTRACT set for enum classes when it is not required | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Olivier Thomann <Olivier_Thomann> |
Component: | Core | Assignee: | JDT-Core-Inbox <jdt-core-inbox> |
Status: | RESOLVED WONTFIX | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | CC: | daniel_megert, Peter_Shipton, philippe_mulet |
Version: | 3.1 | ||
Target Milestone: | 3.1 RC3 | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Whiteboard: |
Description
Olivier Thomann
2005-06-13 10:15:32 EDT
Philippe : candidate for RC3. +1 for RC3 Dani: pls also approve this one. After final bit, there is an issue with abstract bit where we are inconsistent. +1 for 3.1 RC3. Philippe, for this case: public enum EnumTest { B { int value() { return 1; } }; int value(){ return 0; } } the test fieldDecl.initialization instanceof QualifiedAllocationExpression from ClassScope.checkAndSetModifiers() is not sufficient: TypeDeclaration typeDeclaration = this.referenceContext; FieldDeclaration[] fields = typeDeclaration.fields; int length = typeDeclaration.fields == null ? 0 : typeDeclaration.fields.length; checkAbstractEnum: { if (length == 0) break checkAbstractEnum; // must implement the method itself for (int i = 0; i < length; i++) { FieldDeclaration fieldDecl = fields[i]; if (fieldDecl.getKind() == AbstractVariableDeclaration.ENUM_CONSTANT) if (!(fieldDecl.initialization instanceof QualifiedAllocationExpression)) break checkAbstractEnum; } modifiers |= AccAbstract; } Any ideas? Added EnumTest test114. We are better than before but still not 100%. We still tag enums that implement all the methods defined by an interface as abstract, such as: enum EnumX implements I { BLUE {}; public void foo(){} } interface I { void foo(); } As of now 'LATER' and 'REMIND' resolutions are no longer supported. Please reopen this bug if it is still valid for you. |