Files
Alexandr Suhinin 0e860160e5 [extract method] fork tests
GitOrigin-RevId: 3aae5c738d48c38144f6a78c36738121831ae5a5
2020-03-31 12:32:01 +00:00

28 lines
717 B
Java

import java.io.IOException;
import java.sql.SQLException;
import java.util.concurrent.ThreadLocalRandom;
class A {
void f() {
int i = 0;
try {
i = 1;
try {
i = 2;
if (r()) throw new IOException();
<selection>i = 3;
if (r()) throw new SQLException();
i = 4;</selection>
System.out.println("ok");
} catch (IOException e) {
System.out.println("io " + i);
}
} catch (SQLException e) {
System.out.println("sql");
}
}
private boolean r() {
return ThreadLocalRandom.current().nextBoolean();
}
}