mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-10 13:17:09 +07:00
IDEA-55556 Inspection suggestion: Comparison that is always false due to being out of type range on implicit type conversion
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
class Foo {
|
||||
|
||||
private void foo(byte myByte) {
|
||||
if (<warning descr="Condition 'myByte == 0xFF' is always 'false'">myByte == 0xFF</warning>) {
|
||||
System.out.println("wrong");
|
||||
}
|
||||
if (<warning descr="Condition 'myByte != 0xFFF' is always 'true'">myByte != 0xFFF</warning>) {
|
||||
System.out.println("wrong");
|
||||
}
|
||||
if (myByte == (byte) 0xFF) {
|
||||
System.out.println("right");
|
||||
}
|
||||
}
|
||||
|
||||
void foo2(int i) {
|
||||
boolean a = <warning descr="Condition 'i < 0x80000000L' is always 'true'">i < 0x80000000L</warning>;
|
||||
boolean f = <warning descr="Condition 'i > 0x7fffffff' is always 'false'">i > 0x7fffffff</warning>;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user