mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-27 01:29:17 +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.
14 lines
472 B
Java
14 lines
472 B
Java
// "Replace Optional.isPresent() condition with functional style expression" "GENERIC_ERROR_OR_WARNING"
|
|
|
|
import org.jetbrains.annotations.NotNull;
|
|
|
|
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, @NotNull Object> onPresent, Supplier<Object> onEmpty) {
|
|
Object o = opt.i<caret>sPresent() ? onPresent.apply(opt.get()) : onEmpty.get();
|
|
}
|
|
} |