Bug 95703

Summary: 3.1:tct 125- Clarification for translation
Product: [Eclipse Project] JDT Reporter: Cam-Thu Le <camle>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: phuff
Version: 3.1   
Target Milestone: 3.1 RC1   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Cam-Thu Le CLA 2005-05-18 00:23:57 EDT
In the 
eclipse\plugins\org.eclipse.jdt.core\jdtcore_jar\org\eclipse\jdt\internal\compi
ler\problem\messages.properties, 
Line 534, 
"The field {0}.{1} cannot be referenced from an enum case label; only enum 
constants can be used in enum switch." 

Please advise the meaning of "enum switch". 
Thank you very much.
Comment 1 Philipe Mulet CLA 2005-05-18 04:33:17 EDT
In JLS3, switch can be performed on enum values (as opposed to just int values
up until). 
e.g. enum Color { BLUE, WHITE, RED }
     ...
     void foo(Color c) {
       switch(c) {
         case BLUE : ...
         case WHITE : ...
       }
     }

So when a switch perform on an enum, we say "enum switch".

This particular error message arises when some user code tries to mix int
constants and enum constants in switch case label (where value is of enum type).
Comment 2 Philipe Mulet CLA 2005-05-19 18:28:27 EDT
Ok to close?
Comment 3 Philipe Mulet CLA 2005-05-24 11:55:13 EDT
fixed
Comment 4 Philipe Mulet CLA 2005-05-24 19:28:16 EDT
fixed
Comment 5 Maxime Daniel CLA 2005-05-27 10:44:11 EDT
Verified on build I20050527-0010.