| 1 |
import java.util.Collections; |
| 2 |
import java.util.List; |
| 3 |
import java.util.Objects; |
| 4 |
import java.util.stream.Collectors; |
| 5 |
import org.checkerframework.checker.nullness.qual.Nullable; |
| 6 |
|
| 7 |
class Issue1630 { |
| 8 |
static @Nullable String toString(Object o) { |
| 9 |
return null; |
| 10 |
} |
| 11 |
|
| 12 |
@SuppressWarnings("nullness") // Issue 979 |
| 13 |
public static List<String> f(List<Integer> xs) { |
| 14 |
return xs != null |
| 15 |
? xs.stream() |
| 16 |
.map(Issue1630::toString) |
| 17 |
.filter(Objects::nonNull) |
| 18 |
.collect(Collectors.toList()) |
| 19 |
: Collections.emptyList(); |
| 20 |
} |
| 21 |
} |