mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-11 02:39:37 +07:00
If we cannot determine the non-nullity of map expression, then info level is used. Fixes IDEA-172609 "Replace Optional.isPresent() checks with functional-style expressions" is broken.
13 lines
484 B
Java
13 lines
484 B
Java
// "Replace Optional.isPresent() condition with functional style expression" "INFORMATION"
|
|
|
|
import java.util.Optional;
|
|
import java.util.function.Function;
|
|
import java.util.function.Supplier;
|
|
|
|
public class Main {
|
|
|
|
public void test(Optional<String> opt, Function<String, Object> onPresent, Supplier<Object> onEmpty) {
|
|
// information level: could be semantic change if onPresent returns null
|
|
Object o = opt.is<caret>Present() ? onPresent.apply(opt.get()) : onEmpty.get();
|
|
}
|
|
} |