Files
openide/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/surroundWithTry/afterArrayInitializer.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

22 lines
468 B
Java

// "Surround with try/catch" "true"
public class ExTest {
public static String maybeThrow(String data) throws Ex {
throw new Ex(data);
}
{
String[] a = new String[0];
try {
a = new String[]{maybeThrow("")};
} catch (Ex e) {
throw new RuntimeException(e);
}
System.out.println(a);
}
private static class Ex extends Exception {
public Ex(String s) {
}
}
}