mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-01 10:48:09 +07:00
12 lines
332 B
Java
12 lines
332 B
Java
// "Replace Optional.isPresent() condition with functional style expression" "false"
|
|
|
|
import java.util.Arrays;
|
|
import java.util.List;
|
|
import java.util.Optional;
|
|
|
|
public class Main {
|
|
void test(Optional<String> foo) {
|
|
int defaultValue = 0;
|
|
double bar = foo.isPresent<caret>() ? foo.get().length() * 1.2 : defaultValue;
|
|
}
|
|
} |