mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
Fixes IDEA-200364 Checking equality between int and double confuses "Constant condition and exception" inspection
16 lines
479 B
Java
16 lines
479 B
Java
class WideningToDouble {
|
|
public static void main(String[] args) {
|
|
long x = 1L << 54;
|
|
double y = x + 1;
|
|
boolean trueValue = <warning descr="Condition 'x == y' is always 'true'">x == y</warning>; // ASSIGNMENT
|
|
System.out.println(trueValue); // prints "true"
|
|
}
|
|
|
|
void test() {
|
|
int y = 2;
|
|
if (<warning descr="Condition 'y == 2.1' is always 'false'">y == 2.1</warning>) {
|
|
System.out.println("true");
|
|
} else
|
|
System.out.println("false");
|
|
}
|
|
} |