Community
Participate
Working Groups
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.
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).
Ok to close?
fixed
Verified on build I20050527-0010.