mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 15:27:45 +07:00
dfa: treat different constants with same values as same (IDEA-121837)
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
import org.jetbrains.annotations.Contract;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
class Doo {
|
||||
|
||||
static final int TYPE_1 = 20;
|
||||
static final int TYPE_2 = 20;
|
||||
|
||||
public static void failedSecondCondition(int type) {
|
||||
if(type != TYPE_1) {
|
||||
return;
|
||||
}
|
||||
|
||||
if(<warning descr="Condition 'type != TYPE_2' is always 'false'">type != TYPE_2</warning>) {
|
||||
System.out.println();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
class Doo2 {
|
||||
|
||||
static final int TYPE_1 = 200;
|
||||
static final int TYPE_2 = 200;
|
||||
|
||||
public static void failedSecondCondition(int type) {
|
||||
if(type != TYPE_1) {
|
||||
return;
|
||||
}
|
||||
|
||||
if(<warning descr="Condition 'type != TYPE_2' is always 'false'">type != TYPE_2</warning>) {
|
||||
System.out.println();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user