[java-annotations] getOrDefault 2nd parameter is marked as nullable

Fixes IDEA-367387 Mismatch between IDEA and JSpecify on HashMap.getDefault(...) nullness

GitOrigin-RevId: 6e90dcdac5b61aa91431f96d007261ad448ea522
This commit is contained in:
Tagir Valeev
2025-02-13 11:05:42 +00:00
committed by intellij-monorepo-bot
parent 90e67979e7
commit b007ebf865
3 changed files with 22 additions and 0 deletions
@@ -0,0 +1,13 @@
import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;
import java.util.HashMap;
@NullMarked
class Main {
HashMap<String, String> map = new HashMap<>();
public @Nullable String example() {
return map.getOrDefault("key", null);
}
}