diff options
Diffstat (limited to 'java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/surroundWithTry/afterArrayInitializer.java')
-rw-r--r-- | java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/surroundWithTry/afterArrayInitializer.java | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/surroundWithTry/afterArrayInitializer.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/surroundWithTry/afterArrayInitializer.java new file mode 100644 index 000000000000..fda3c915e4da --- /dev/null +++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/surroundWithTry/afterArrayInitializer.java @@ -0,0 +1,22 @@ +// "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 ex) { + ex.printStackTrace(); + } + System.out.println(a); + } + + + private static class Ex extends Exception { + public Ex(String s) { + } + } +}
\ No newline at end of file |