Files
openide/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/addCatchBlock/after6.java
Anna Kozlova b0293a79d3 [java]: add catch section: prefer same simple names for catch parameters (IDEA-273255)
GitOrigin-RevId: fe5ef7298cddeb74fd8775bb68361b91c58e5d40
2021-07-07 20:19:50 +00:00

19 lines
504 B
Java

// "Add 'catch' clause(s)" "true"
class Test {
static class E1 extends Exception { }
static class E2 extends Exception { }
static class MyResource implements AutoCloseable {
public void doSomething() throws E1 { }
public void close() throws E2 { }
}
void m() {
try (MyResource r = new MyResource()) {
r.doSomething();
} catch (E1 ignore) {
} catch (E2 e) {
<selection>e.printStackTrace();</selection>
}
}
}