mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-08 03:29:08 +07:00
11 lines
276 B
Java
11 lines
276 B
Java
// "Replace with Optional.ofNullable() chain" "GENERIC_ERROR_OR_WARNING"
|
|
|
|
import java.util.Optional;
|
|
|
|
class Test {
|
|
String foo;
|
|
|
|
String select(Test other) {
|
|
return Optional.ofNullable(foo).map(s -> other.foo.trim() + s.trim()).orElseGet(() -> other.foo + null);
|
|
}
|
|
} |