mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
dfa: suggest to replace variable with int constant (IDEA-111178)
This commit is contained in:
+10
@@ -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>);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
+10
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
+13
@@ -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;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user