Community
Participate
Working Groups
BETA_JAVA7 Currently for an invalid type inside a switch statement, we warn Cannot switch on a value of type {0}. Only convertible int values or enum constants are permitted. From 1.7 onwards however, strings are permitted too, so the warning for 1.7 should reflect that. public class Try { void f(Object a) { final String xyzz = ""; switch (a){ // error here case xyzz: break; } } }
Created attachment 193778 [details] proposed fix Fixes the error message for 1.7 and above
Released in BETA_JAVA7 branch.
(In reply to comment #0) > Cannot switch on a value of type {0}. Only convertible int values or enum > constants are permitted. New error is "Cannot switch on a value of type {0}. Only convertible int values, strings or enum constants are permitted"
Verified using "Eclipse Java Development Tools Patch for Java 7 Support (BETA) 1.0.0.v20110623-0900 org.eclipse.jdt.patch.feature.group Eclipse.org"