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