dfa: suggest to replace variable with int constant (IDEA-111178)

This commit is contained in:
peter
2013-07-29 19:51:56 +02:00
parent d1d92234bb
commit 96d78ee5e8
5 changed files with 39 additions and 1 deletions
@@ -0,0 +1,10 @@
class Test {
public static final int CONST = 23942;
private void test(int a) {
if (a == CONST) {
System.out.println(<caret><warning descr="Value 'a' is always 'CONST'">a</warning>);
}
}
}
@@ -0,0 +1,10 @@
class Test {
public static final int CONST = 23942;
private void test(int a) {
if (a == CONST) {
System.out.println(<caret>CONST);
}
}
}
@@ -6,4 +6,17 @@ class Test {
}
}
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;
}