mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-28 15:20:54 +07:00
29 lines
658 B
Java
29 lines
658 B
Java
// "Add exception to method signature" "false"
|
|
import java.util.concurrent.ExecutionException;
|
|
import java.util.concurrent.TimeoutException;
|
|
|
|
class Freeze implements Runnable {
|
|
|
|
private boolean flag;
|
|
|
|
@Override
|
|
public void run() {
|
|
try (SomeClient client = new SomeClient()) {
|
|
if (flag) {
|
|
client.<caret>run1();
|
|
} else {
|
|
client.run2();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
class SomeClient implements AutoCloseable {
|
|
|
|
public void run1() throws InterruptedException, ExecutionException, TimeoutException {}
|
|
|
|
public void run2() throws InterruptedException, ExecutionException, TimeoutException {}
|
|
|
|
@Override
|
|
public void close() {}
|
|
}
|