mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-02-05 16:36:56 +07:00
30 lines
678 B
Java
30 lines
678 B
Java
import java.util.*;
|
|
|
|
public class ReduceBinOpOnCast {
|
|
// IDEA-231598
|
|
private void doByte(byte b) {
|
|
System.out.println(b);
|
|
if (b < 0) {
|
|
<warning descr="Variable update does nothing">b</warning> +=256;
|
|
}
|
|
System.out.println(b);
|
|
}
|
|
|
|
void test(int a, short b) {
|
|
if (a == 0xFFFFF) {
|
|
int res = (short)(b + a + 1);
|
|
if (<warning descr="Condition 'res == b' is always 'true'">res == b</warning>) {}
|
|
}
|
|
}
|
|
|
|
void testTwoChecks(int a, short b) {
|
|
if (a == 0x10000 || a == 0x20000 || a == 0) {
|
|
<warning descr="Variable update does nothing">b</warning> += a;
|
|
}
|
|
}
|
|
|
|
void testDoubleCast(int x) {
|
|
double d = x + 1;
|
|
}
|
|
}
|