Community
Participate
Working Groups
----------------------A.java-------------------------- package a; import b.B; public class A { public static void method(final int a, final String b) //<--refactor change // method signature { switch(a) { case B.VALUE_ONE: { break; } case B.VALUE_TWO: { break; } } } } ----------------------------------------------------- -------------------------B.java---------------------- package b; public class B { public static final int VALUE_ONE = 1; public static final int VALUE_TWO = 2; } ------------------------------------------------------- use refactor change method signature to swap the two parameters of the method "method" around. You get an erroneous case expressions must be constant warning!
will investigate - suspecting jcore problem
Asking JDT/Core for comments. We had scenarios in the past where the Java compiler didn't report an error, but the AST did. They where constant expressions as well.
Fixed and released in HEAD. Regression test added.
*** Bug 41516 has been marked as a duplicate of this bug. ***
Verified.