normalize array initializer in surround with try catch (IDEA-128218)

This commit is contained in:
Anna Kozlova
2014-08-14 16:04:52 +04:00
parent 92ee65b87a
commit d27529ff3b
5 changed files with 44 additions and 8 deletions
@@ -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) {
}
}
}
@@ -0,0 +1,17 @@
// "Surround with try/catch" "true"
public class ExTest {
public static String maybeThrow(String data) throws Ex {
throw new Ex(data);
}
{
String[] a = {mayb<caret>eThrow("")};
System.out.println(a);
}
private static class Ex extends Exception {
public Ex(String s) {
}
}
}