* configure.ac: New switch for disabling -O2 (--disable-optimizations).
[cacao.git] / tests / stack / stubexceptions2.java
1 class MyTestClass2 {
2
3         public MyTestClass2(int i) throws Exception {
4                 switch (i) {
5                         case 0:
6                                 throw new Exception("Exception in constructor");
7                         case 1:
8                                 int iarray[]=new int[10];
9                                 iarray[11]=0;
10                                 break;
11                         case 2:
12                                 MyTestClass2 x=null;
13                                 x.doSomething();
14                                 break;
15                         case 3:
16                                 System.out.println("Create new class");
17                                 MyTestClass2 y=new MyTestClass2(3);
18                                 break;
19                 }
20         }
21
22         public void doSomething() {
23                 System.out.println("Something done");
24         }
25 }
26
27 public class stubexceptions2 {
28
29         public static void main(String args[]) {
30                 System.out.println("Test1");
31
32                 for (int i=0;i<4;i++) {
33                         MyTestClass2 x=null;
34                         try {
35                                 x=new MyTestClass2(i);
36                                 x.doSomething();
37                         } catch (Exception e) {
38                                 e.printStackTrace();
39                         }
40                 }
41         }
42 }