mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-23 16:20:55 +07:00
PR#2100 Co-authored-by: Tagir Valeev <tagir.valeev@jetbrains.com> GitOrigin-RevId: c0b8495f26bccf51c593deb6be927eb01c37d379
28 lines
722 B
Java
28 lines
722 B
Java
// "Replace Optional presence condition with functional style expression" "INFORMATION"
|
|
|
|
import java.util.Optional;
|
|
|
|
public class Test {
|
|
public static void main(String[] args) {
|
|
for(String arg : args) {
|
|
Optional<String> opt = Optional.of("xyz");
|
|
opt.ifPresent(s -> {
|
|
System.out.println(s);
|
|
System.out.println(s);
|
|
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(s);
|
|
throw new RuntimeException();
|
|
});
|
|
}
|
|
}
|
|
}
|