Files
openide/java/java-tests/testData/inspection/dataFlow/fixture/RootThrowableCause.java
2014-09-01 20:28:35 +02:00

29 lines
495 B
Java

import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.Nullable;
class Doo {
void foo(Throwable e) {
Throwable t = e;
while (t.getCause() != null) t = t.getCause();
if (e != t) {
System.out.println();
}
}
}
abstract class Test04 {
@Nullable
@Contract(pure = true)
abstract Test04 getParent();
Test04 getTopParent() {
Test04 top = this;
while (top.getParent() != null) {
top = top.getParent();
}
return top;
}
}