Files
openide/java/java-tests/testData/inspection/dataFlow/fixture/LongCircuitOperations.java
T
2013-09-12 22:15:05 +04:00

35 lines
775 B
Java

import org.jetbrains.annotations.NotNull;
class X {
int foo(String d1, String d2) {
if(d1 == null | d2 == null)
return 0;
return d1.compareTo(d2);
}
void foo2(String d1, String d2) {
if(<warning descr="Condition 'd1 == null & d1 != null' is always 'false'">d1 == null & d1 != null</warning>)
System.out.println("impossible");
}
void foo3(String d1, String d2) {
if(d1 == null | <warning descr="Method invocation 'd1.compareTo(d2)' may produce 'java.lang.NullPointerException'">d1.compareTo(d2)</warning> > 0)
System.out.println("impossible");
}
}
class Doo {
void zoo(@NotNull Object t, @NotNull Object s) {
}
private void goo(Object t, Object t2) {
if (t != null & t2 != null) {
zoo(t, t2);
}
}
}