mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
dfa: IDEA-146950 "<" expr is always false but "<=" is not
This commit is contained in:
+2
@@ -549,10 +549,12 @@ public class StandardInstructionVisitor extends InstructionVisitor {
|
||||
if (opSign == LT && comparedWith <= rangeMin) return alwaysFalse(instruction, runner, memState);
|
||||
if (opSign == LT && comparedWith > rangeMax) return alwaysTrue(instruction, runner, memState);
|
||||
if (opSign == LE && comparedWith >= rangeMax) return alwaysTrue(instruction, runner, memState);
|
||||
if (opSign == LE && comparedWith < rangeMin) return alwaysFalse(instruction, runner, memState);
|
||||
|
||||
if (opSign == GT && comparedWith >= rangeMax) return alwaysFalse(instruction, runner, memState);
|
||||
if (opSign == GT && comparedWith < rangeMin) return alwaysTrue(instruction, runner, memState);
|
||||
if (opSign == GE && comparedWith <= rangeMin) return alwaysTrue(instruction, runner, memState);
|
||||
if (opSign == GE && comparedWith > rangeMax) return alwaysFalse(instruction, runner, memState);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
+7
-2
@@ -1,5 +1,3 @@
|
||||
import java.util.Arrays;
|
||||
|
||||
class Test {
|
||||
int[] mIndex = null;
|
||||
int mSize = 0;
|
||||
@@ -13,4 +11,11 @@ class Test {
|
||||
|
||||
mIndex[0] = -1;
|
||||
}
|
||||
|
||||
void bar() {
|
||||
int time = 99;
|
||||
String str = <warning descr="Condition 'time < 0' is always 'false'">time < 0</warning> ? "" : "";
|
||||
String str1 = <warning descr="Condition 'time <= 0' is always 'false'">time <= 0</warning> ? "" : "";
|
||||
String str2 = <warning descr="Condition 'time >= 100' is always 'false'">time >= 100</warning> ? "" : "";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user