mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-22 14:50:53 +07:00
PR#2100 Co-authored-by: Tagir Valeev <tagir.valeev@jetbrains.com> GitOrigin-RevId: c0b8495f26bccf51c593deb6be927eb01c37d379
26 lines
632 B
Java
26 lines
632 B
Java
// "Replace Optional presence condition with functional style expression" "false"
|
|
|
|
import java.util.Optional;
|
|
|
|
public class Test {
|
|
public static void main(String[] args) {
|
|
for(String arg : args) {
|
|
Optional<String> opt = Optional.of("xyz");
|
|
if (opt.isPre<caret>sent()) {
|
|
System.out.println(opt.get());
|
|
System.out.println(opt.get());
|
|
Runnable r = () -> {return;};
|
|
for(int i=0; i<10; i++) {
|
|
if(i == 3) continue;
|
|
System.out.println(arg);
|
|
if(i == 5)
|
|
break;
|
|
|
|
}
|
|
System.out.println(opt.get());
|
|
continue;
|
|
}
|
|
}
|
|
}
|
|
}
|