mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 15:27:45 +07:00
Java: Infer nullability annotations for extracted method's parameters (IDEA-150243)
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
class C {
|
||||
void f() {
|
||||
I i = new I() {
|
||||
@Override
|
||||
public void m(@Nullable Object o) {
|
||||
if (o != null) {
|
||||
newMethod(o);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private void newMethod(@NotNull Object o) {
|
||||
if (o instanceof String) {
|
||||
o = 2;
|
||||
} else {
|
||||
System.out.println(o);
|
||||
}
|
||||
g(o);
|
||||
}
|
||||
|
||||
void g(@NotNull Object o) {
|
||||
}
|
||||
|
||||
interface I {
|
||||
void m(Object o);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user