From https://bugs.eclipse.org/bugs/show_bug.cgi?id=195757
public class X {
boolean test() {
return true;
}
int foo() {
if ((test() ? null : null) == null)
return 1;
return 0;
}
// more complex
int bar() {
String s = null;
if ((test() ? s : null) == null)
return 1;
return 0;
}
}
In both case, a "redundant null check" should be reported.
For initial discussion see bugzilla.