mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 15:27:45 +07:00
MR brings detection of nullable inconsistencies inside return expressions for generic types. Now it supports - Support of arbitrary generic type (previously only collections was supported) - Recursive detection of inconsistencies - Detection of assigning not-null to nullable (via option) GitOrigin-RevId: ed37ea02ca44db58698f36f2ca82c67171733e69
14 lines
511 B
Java
14 lines
511 B
Java
import typeUse.*;
|
|
import java.util.*;
|
|
|
|
class Test {
|
|
|
|
public @NotNull Map<@NotNull String, @NotNull ArrayList<@NotNull String>> getDataBroken() {
|
|
ArrayList<@Nullable String> arrayList = new ArrayList<>();
|
|
arrayList.add(null);
|
|
|
|
@NotNull Map<@NotNull String, @NotNull ArrayList<@Nullable String>> map = new HashMap<>();
|
|
map.put("x", arrayList);
|
|
return <warning descr="Returning a class with nullable type parameters when a class with non-null type parameters is expected">map</warning>;
|
|
}
|
|
} |