mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-02-19 12:06:54 +07:00
Fix for IDEA-165369 Replace Optional.isPresent() should be disabled if the thenBranch contains non-local control flow
28 lines
725 B
Java
28 lines
725 B
Java
// "Replace Optional.isPresent() 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();
|
|
});
|
|
}
|
|
}
|
|
}
|