Files
Bart van Helvertandintellij-monorepo-bot 94d5fdf882 [java] Replace not-null with non-null
To make error messages consistent #IDEA-374747 Fixed


(cherry picked from commit 328c5b355fcf56a7d1c165aab32220d37bdfcbc1)

IJ-MR-170004

GitOrigin-RevId: f00fb74ddbff84b18839c60648d664774d566966
2025-07-22 21:25:49 +00:00

23 lines
866 B
Java

import typeUse.*;
import java.util.*;
class JC {
public static Collection<@Nullable Object> getNullableStuff() {
return Collections.emptyList();
}
public static Collection<@NotNull Object> getNotNullStuff() {
return Collections.emptyList();
}
void usage() {
for (<warning descr="Parameter can be null">@NotNull</warning> Object o : getNullableStuff()) {
System.out.println(o.getClass());
}
for (<warning descr="Parameter is always non-null">@Nullable</warning> Object o : getNotNullStuff()) {
System.out.println(o.getClass());
}
getNullableStuff().forEach((<warning descr="Parameter can be null">@NotNull</warning> Object s) -> System.out.println(s.hashCode()));
getNotNullStuff().forEach((<warning descr="Parameter is always non-null">@Nullable</warning> Object s) -> System.out.println(s.hashCode()));
}
}