mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-02-05 16:36:56 +07:00
24 lines
578 B
Java
24 lines
578 B
Java
import java.util.List;
|
|
|
|
class Test {
|
|
void test(Object x, Object y) {
|
|
if(x.equals(x)) {
|
|
// do not report here; reported by EqualsWithItselfInspection
|
|
System.out.println("always");
|
|
}
|
|
if(!x.equals(x)) {
|
|
// do not report here; reported by EqualsWithItselfInspection
|
|
System.out.println("never");
|
|
}
|
|
y = x;
|
|
if(<warning descr="Condition 'x.equals(y)' is always 'true'">x.equals(y)</warning>) {
|
|
System.out.println("always");
|
|
}
|
|
}
|
|
|
|
void test(Boolean x) {
|
|
if(x.equals(true)) {
|
|
System.out.println("oops");
|
|
}
|
|
}
|
|
} |