mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-02-05 08:06:56 +07:00
12 lines
316 B
Java
12 lines
316 B
Java
// "Simplify optional chain to 'getOpt().map(...)'" "true"
|
|
import java.util.Optional;
|
|
|
|
public class Test {
|
|
public Optional<String> test() {
|
|
return getOpt().map(x -> Optional.ofNullable(x.trim())).orEl<caret>seGet(Optional::empty);
|
|
}
|
|
|
|
private Optional<String> getOpt() {
|
|
return Optional.of("foo");
|
|
}
|
|
} |