mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-02-05 16:36:56 +07:00
Fixes IDEA-290952 Constant conditions & expression warns about NullPointerException for Objects.nonNull with checked "Treat non-annotated members and parameters as @Nullable" GitOrigin-RevId: 88b063f12031b85dfa9fb7a009f75ebf0673760a
13 lines
351 B
Java
13 lines
351 B
Java
import java.util.*;
|
|
import java.util.function.*;
|
|
import typeUse.*;
|
|
|
|
public class ObjectsNonNullWithUnknownNullable {
|
|
void foo(@NotNull List<@NotNull String> list) {
|
|
Predicate<String> predicate = Objects::nonNull;
|
|
list.stream()
|
|
.map(s -> s.isEmpty() ? null : s)
|
|
.filter(Objects::nonNull)
|
|
.forEach(System.out::println);
|
|
}
|
|
} |