Files
Tagir Valeev b58f63db9e [java-intentions] Test for IDEA-367517
GitOrigin-RevId: 629874907d950626a912c2fbd6c8bb9b50b93902
2025-02-17 12:04:21 +00:00

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() {}
}