mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-02-06 01:06:54 +07:00
22 lines
599 B
Java
22 lines
599 B
Java
class NumericCast {
|
|
void test(int i) {
|
|
if(i > 10 && i < 200) {
|
|
byte b = (byte) i;
|
|
if (<warning descr="Condition 'b == 0' is always 'false'">b == 0</warning>) {
|
|
System.out.println("impossible");
|
|
}
|
|
}
|
|
byte b = 100;
|
|
b+=100;
|
|
if (<warning descr="Condition 'b == -56' is always 'true'">b == -56</warning>) {
|
|
System.out.println("always");
|
|
}
|
|
}
|
|
|
|
void testMask(long x) {
|
|
int bits = (int) ((x >> 16) & 0xFFFF);
|
|
if (<warning descr="Condition 'bits >= 0' is always 'true'">bits >= 0</warning>) {
|
|
System.out.println("Always");
|
|
}
|
|
}
|
|
} |