[java-analysis] IDEA-375799 Container nullability annotation on the method has no effect on method return type

GitOrigin-RevId: f7cead47f32b2befeabe116a6c2df87682cb1cd2
This commit is contained in:
Tagir Valeev
2025-07-11 17:16:17 +00:00
committed by intellij-monorepo-bot
parent 38f08a531b
commit 9c6ce129bb
4 changed files with 29 additions and 2 deletions
@@ -0,0 +1,14 @@
import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.NullUnmarked;
import org.jspecify.annotations.Nullable;
import java.util.List;
@NullMarked
class Container<T extends @Nullable Object> {
@NullUnmarked
List<T> get() {
return <warning descr="'null' is returned by the method which is not declared as @Nullable">null</warning>;
}
}