[java-psi] IDEA-379919 Guava. Possible NPE is not highlighted. Common type can be nullable?

GitOrigin-RevId: 1a7b4c1521d85e1424bf371fcaea97f062a6b50d
This commit is contained in:
Tagir Valeev
2025-09-26 15:31:28 +00:00
committed by intellij-monorepo-bot
parent d337da646a
commit 7e4ed9a6c2
2 changed files with 14 additions and 1 deletions
@@ -16,7 +16,19 @@ class MyTest {
Iterable<T> iterable, int position);
}
void foo1(List<@Nullable Integer> l1, List<@Nullable String> l2) {
for (Object s : Iterables.concat(l1, l2)) {
System.out.println(s.<warning descr="Method invocation 'toString' may produce 'NullPointerException'">toString</warning>());
}
}
void foo2(List<@Nullable Integer> l1, List<String> l2) {
for (Object s : Iterables.concat(l1, l2)) {
System.out.println(s.<warning descr="Method invocation 'toString' may produce 'NullPointerException'">toString</warning>());
}
}
void toArray(List<@Nullable String> l1) {
for (String s : Iterables.toArray(l1, String.class)) {
System.out.println(s.<warning descr="Method invocation 'length' may produce 'NullPointerException'">length</warning>());