IDEA-129331 False positive for possible NPE

This commit is contained in:
peter
2014-09-01 20:28:35 +02:00
parent ed392c7308
commit f69054854d
2 changed files with 20 additions and 1 deletions
@@ -1,3 +1,6 @@
import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.Nullable;
class Doo {
void foo(Throwable e) {
@@ -9,4 +12,18 @@ class Doo {
}
}
}
abstract class Test04 {
@Nullable
@Contract(pure = true)
abstract Test04 getParent();
Test04 getTopParent() {
Test04 top = this;
while (top.getParent() != null) {
top = top.getParent();
}
return top;
}
}