Community
Participate
Working Groups
Test case : file : A.java public class A { public void method() { switch(1) { case B.ONE : break; case B.TWO : break; } } } file : B.java public interface B { int ONE = 1; int TWO = 2; } If you compile these the A.java, there shouldn't have any compilation error. However, in : IProblem[] probs = compilationUnit.getProblems(); // org.eclipse.jdt.core.dom.CompilationUnit You will see two errors are found. Both are "case expressions must be constant expressions"
Looks like a duplicate of bug 40476.
Close as duplicate of bug 40476. *** This bug has been marked as a duplicate of 40476 ***