mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 22:51:17 +07:00
15 lines
393 B
Java
15 lines
393 B
Java
// "Fix all ''Optional' can be replaced with sequence of 'if' statements' problems in file" "true"
|
|
|
|
import java.util.Optional;
|
|
import java.util.stream.Stream;
|
|
|
|
class Test {
|
|
|
|
void stream(String in) {
|
|
Stream<String> out = Stream.empty();
|
|
if (in == null) throw new NullPointerException();
|
|
String s = in.length() > 2 ? in : null;
|
|
if (s != null) out = Stream.of(s);
|
|
}
|
|
|
|
} |