mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-22 04:43:02 +07:00
Fixes IDEA-250913 Inspection "Constant conditions and exceptions" does not catch "Unboxing may produce NullPointerException" in stream operations GitOrigin-RevId: 536668db2e1b3bb5307cccff710f3212d07bce2e
23 lines
556 B
Java
23 lines
556 B
Java
import org.jetbrains.annotations.*;
|
|
import java.util.stream.*;
|
|
|
|
// IDEA-250913
|
|
class Test {
|
|
void main() {
|
|
print(<warning descr="Unboxing of 'parse(\"1\")' may produce 'NullPointerException'">parse("1")</warning>);
|
|
|
|
Stream.of("1", "2")
|
|
.map(this::parse)
|
|
.forEach(<warning descr="Passing an argument to the method reference requires unboxing which may produce 'NullPointerException'">this::print</warning>);
|
|
|
|
}
|
|
|
|
@Nullable
|
|
Long parse(String s) {
|
|
return null;
|
|
}
|
|
|
|
private void print(long s) {
|
|
System.out.println(s);
|
|
}
|
|
} |