Java: Infer nullability annotations for extracted method's parameters (IDEA-150243)

This commit is contained in:
Pavel Dolgov
2017-06-19 12:54:10 +03:00
parent 99bbe2e66e
commit f060340474
18 changed files with 483 additions and 4 deletions
@@ -0,0 +1,27 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
class C {
void f() {
I i = (@Nullable String o) -> {
if (o != null) {<selection>
if (o instanceof String) {
o = "4";
}
else {
System.out.println(o);
}
g(o);</selection>
}
return "";
};
}
void g(@NotNull Object o) {
}
interface I<T, R> {
R m(T t);
}
}