Community
Participate
Working Groups
When Eclipse encounters a switch statement with qualified enum constants the error message displayed is uninformative: 'The enum constant A.CONST1 reference cannot be qualified in a case label' It says what is wrong but doesn't suggest a solution. Javac gives much better error message: 'An enum switch case label must be the unqualified name of an enumeration constant' This message clearly suggests what user should do to fix the problem. It took me several minutes of googling to find out what's the solution and I finally got it after trying test case and reading patch for Eclipse bug #77151 :) Eclipse 3.3M1
How about? "The qualified case label X.Y.Z must be replaced with the simple enum constant name Z"
'The reference to enum constant CONST1 should not be qualified in a case label' ?
Maybe "The qualified case label X.Y.Z must be replaced with the unqualified enum constant name Z"?
I'm going to use : "The qualified case label X.Y.Z must be replaced with the unqualified enum constant Z" since its similar to these other enum messages : 759 = The field {0}.{1} cannot be referenced from an enum case label; only enum constants can be used in enum switch 761 = The enum constant {0}.{1} has no corresponding case label And I'm going to remove the qualification from the last optional message : 761 = The enum constant {0} needs a corresponding case label in this enum switch
Changed these 2 enum messages : 755 = The qualified case label {0}.{1} must be replaced with the unqualified enum constant {1} 761 = The enum constant {1} needs a corresponding case label in this enum switch on {0}
Fix released for 3.5M4
Verified for 3.5M4 using I20081208-1800. I would however expect the whole qualified constant to be underlined.