Files
openide/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/addCatchBlock/afterHierarchy.java
Anna Kozlova 724ed16f6f [java] replace default catch block template (IDEA-161593)
`throw e` won't fix the compilation error, comment - is not really better than empty catch block.

GitOrigin-RevId: ea002c332900b032392e766f3dd13fe3258ad49c
2022-01-14 20:39:23 +00:00

20 lines
439 B
Java

import java.io.FileNotFoundException;
import java.io.IOException;
// "Add 'catch' clause(s)" "true"
class CatchExceptions {
void foo() throws java.io.IOException, java.io.FileNotFoundException {
}
void bar() {
try {
foo();
} catch (FileNotFoundException e) {
<selection><caret>throw new RuntimeException(e);</selection>
} catch (IOException e) {
throw new RuntimeException(e);
}
}
}