summaryrefslogtreecommitdiff
path: root/java/java-tests/testData/inspection/dataFlow/fixture/ReportConstantReferences_Switch.java
blob: e48dc19555bbcc6fdaf16610b552ad6ed67fdecf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
class Test {
  private void test() {
    int state = 1;
    switch (<warning descr="Value 'state' is always '1'">state</warning>) {
      case 1: break;
    }
  }

  private void test2(int state) {
    switch (state) {
      case ONE:
      case TWO:
        if (state == TWO) {
          System.out.println("hello");
        }
    }
  }

  public static final int ONE = 1;
  public static final int TWO = 2;

}