summaryrefslogtreecommitdiff
path: root/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/surroundWithTry/afterArrayInitializer.java
blob: fda3c915e4daafd2ca916420603b7790afb91531 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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) {
        }
    }
}