Summary: | [1.5][compiler] constant-specific methods in enum cannot be abstract | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Irina Marudina <public> | ||||||
Component: | Core | Assignee: | Philipe Mulet <philippe_mulet> | ||||||
Status: | VERIFIED FIXED | QA Contact: | |||||||
Severity: | normal | ||||||||
Priority: | P3 | CC: | itkach, kent_johnson, philippe_mulet | ||||||
Version: | 3.1.2 | ||||||||
Target Milestone: | 3.2.2 | ||||||||
Hardware: | PC | ||||||||
OS: | Windows XP | ||||||||
Whiteboard: | |||||||||
Attachments: |
|
Description
Irina Marudina
2006-09-07 15:50:46 EDT
Not only we don't detect this case, but we also don't detect abstract method not implemented. public enum X { PLUS { double eval(double x, double y) { return x + y; } }, MINUS { abstract void eval2(Object x, Object y); }; abstract double eval(double x, double y); public static void main(String[] args) {} } In this case, we don't detect that eval2 is abstract and we don't detect that eval is not implemented for MINUS. X ends up being abstract and this is also illegal. See JLS3 8.1.1.1 Created attachment 49701 [details]
Proposed patch
3.3 patch
Created attachment 49705 [details]
Better patch
Improved patch, which also clarifies the AccFinal positionning.
In the past, it was always set, and cleared during enum constant checkAndSetModifiers, which could allow for some discrepancy in the meantime.
Added EnumTest#test138-141. Released for 3.3M2 (HEAD) Will queue the change as well for 3.2.2 (too late for 3.2.1) Verified for 3.3 M2 using build I20060918-0010. Released for 3.2.2 *** Bug 166866 has been marked as a duplicate of this bug. *** Reopen for verification (In reply to comment #6) > Released for 3.2.2 > verified for 3.2.2 using build M20070112-1200 |