Community
Participate
Working Groups
When migrating the java file which includes the case statement, created by VAJ4.0, I encountered an error "case statement must be constant". The test program is a real customer's data, so I cannot attach it in bugzilla. Please contact me off-line and I will send it.
Moving to JDT Core.
We did fix a couple cases where our compiler was too permissive. In particular, expressions denoting constants through a non-static references were incorrectly allowed. e.g. public class X { public final static int CST = 1; public static void main(String[] arguments) { X x = new X(); switch (1) { case x.CST : break; } } } "case x.CST" should be replaced with "case X.CST" or simply "case CST" where it applies. Ok to close? Or is your scenario different from this one ?
Closing, please reopen if you have a test case which we reject incorrectly.