mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
ConstantDoubleComparisons: add gt/lt comparisons
This commit is contained in:
@@ -21,4 +21,22 @@ class Foo {
|
||||
Double posz = +0.0, negz = -0.0;
|
||||
System.out.println(<warning descr="Result of 'posz.equals(negz)' is always 'false'">posz.equals(negz)</warning>);
|
||||
}
|
||||
|
||||
void gtLt() {
|
||||
double x = 5.0;
|
||||
double y = 6.0;
|
||||
if (<warning descr="Condition 'x > y' is always 'false'">x > y</warning>) {}
|
||||
if (<warning descr="Condition 'x >= y' is always 'false'">x >= y</warning>) {}
|
||||
if (<warning descr="Condition 'x > 4' is always 'true'">x > 4</warning>) {}
|
||||
if (<warning descr="Condition 'y < 3' is always 'false'">y < 3</warning>) {}
|
||||
}
|
||||
|
||||
void gtLtBoxed() {
|
||||
Double x = 5.0;
|
||||
Double y = 6.0;
|
||||
if (<warning descr="Condition 'x > y' is always 'false'">x > y</warning>) {}
|
||||
if (<warning descr="Condition 'x >= y' is always 'false'">x >= y</warning>) {}
|
||||
if (<warning descr="Condition 'x > 4' is always 'true'">x > 4</warning>) {}
|
||||
if (<warning descr="Condition 'y < 3' is always 'false'">y < 3</warning>) {}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user