xref: /aosp_15_r20/dalvik/dx/tests/080-dex-exception-tables/Blort.java (revision 055d459012065f78d96b68be8421640240ddf631)
1*055d4590SKeyi Gui /*
2*055d4590SKeyi Gui  * Copyright (C) 2007 The Android Open Source Project
3*055d4590SKeyi Gui  *
4*055d4590SKeyi Gui  * Licensed under the Apache License, Version 2.0 (the "License");
5*055d4590SKeyi Gui  * you may not use this file except in compliance with the License.
6*055d4590SKeyi Gui  * You may obtain a copy of the License at
7*055d4590SKeyi Gui  *
8*055d4590SKeyi Gui  *      http://www.apache.org/licenses/LICENSE-2.0
9*055d4590SKeyi Gui  *
10*055d4590SKeyi Gui  * Unless required by applicable law or agreed to in writing, software
11*055d4590SKeyi Gui  * distributed under the License is distributed on an "AS IS" BASIS,
12*055d4590SKeyi Gui  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13*055d4590SKeyi Gui  * See the License for the specific language governing permissions and
14*055d4590SKeyi Gui  * limitations under the License.
15*055d4590SKeyi Gui  */
16*055d4590SKeyi Gui 
17*055d4590SKeyi Gui public class Blort
18*055d4590SKeyi Gui {
call1()19*055d4590SKeyi Gui     public static void call1() { }
call2()20*055d4590SKeyi Gui     public static void call2() { }
call3()21*055d4590SKeyi Gui     public static void call3() { }
call4()22*055d4590SKeyi Gui     public static void call4() { }
call5()23*055d4590SKeyi Gui     public static void call5() { }
24*055d4590SKeyi Gui 
test1()25*055d4590SKeyi Gui     public static int test1() {
26*055d4590SKeyi Gui         try {
27*055d4590SKeyi Gui             call1();
28*055d4590SKeyi Gui             call2();
29*055d4590SKeyi Gui         } catch (IndexOutOfBoundsException ex) {
30*055d4590SKeyi Gui             return 10;
31*055d4590SKeyi Gui         } catch (RuntimeException ex) {
32*055d4590SKeyi Gui             return 11;
33*055d4590SKeyi Gui         }
34*055d4590SKeyi Gui 
35*055d4590SKeyi Gui         call3();
36*055d4590SKeyi Gui         return 12;
37*055d4590SKeyi Gui     }
38*055d4590SKeyi Gui 
test2()39*055d4590SKeyi Gui     public static int test2() {
40*055d4590SKeyi Gui         try {
41*055d4590SKeyi Gui             call1();
42*055d4590SKeyi Gui             try {
43*055d4590SKeyi Gui                 call2();
44*055d4590SKeyi Gui             } catch (IndexOutOfBoundsException ex) {
45*055d4590SKeyi Gui                 return 10;
46*055d4590SKeyi Gui             }
47*055d4590SKeyi Gui             call3();
48*055d4590SKeyi Gui         } catch (RuntimeException ex) {
49*055d4590SKeyi Gui             return 11;
50*055d4590SKeyi Gui         }
51*055d4590SKeyi Gui 
52*055d4590SKeyi Gui         return 12;
53*055d4590SKeyi Gui     }
54*055d4590SKeyi Gui 
test3()55*055d4590SKeyi Gui     public static int test3() {
56*055d4590SKeyi Gui         try {
57*055d4590SKeyi Gui             call1();
58*055d4590SKeyi Gui             try {
59*055d4590SKeyi Gui                 call2();
60*055d4590SKeyi Gui                 try {
61*055d4590SKeyi Gui                     call3();
62*055d4590SKeyi Gui                 } catch (NullPointerException ex) {
63*055d4590SKeyi Gui                     return 10;
64*055d4590SKeyi Gui                 }
65*055d4590SKeyi Gui                 call4();
66*055d4590SKeyi Gui             } catch (IndexOutOfBoundsException ex) {
67*055d4590SKeyi Gui                 return 11;
68*055d4590SKeyi Gui             }
69*055d4590SKeyi Gui             call5();
70*055d4590SKeyi Gui         } catch (RuntimeException ex) {
71*055d4590SKeyi Gui             return 12;
72*055d4590SKeyi Gui         }
73*055d4590SKeyi Gui 
74*055d4590SKeyi Gui         return 13;
75*055d4590SKeyi Gui     }
76*055d4590SKeyi Gui 
test4()77*055d4590SKeyi Gui     public static int test4() {
78*055d4590SKeyi Gui         try {
79*055d4590SKeyi Gui             call1();
80*055d4590SKeyi Gui             try {
81*055d4590SKeyi Gui                 call2();
82*055d4590SKeyi Gui                 try {
83*055d4590SKeyi Gui                     call3();
84*055d4590SKeyi Gui                 } catch (NullPointerException ex) {
85*055d4590SKeyi Gui                     return 10;
86*055d4590SKeyi Gui                 }
87*055d4590SKeyi Gui             } catch (IndexOutOfBoundsException ex) {
88*055d4590SKeyi Gui                 return 11;
89*055d4590SKeyi Gui             }
90*055d4590SKeyi Gui             call5();
91*055d4590SKeyi Gui         } catch (RuntimeException ex) {
92*055d4590SKeyi Gui             return 12;
93*055d4590SKeyi Gui         }
94*055d4590SKeyi Gui 
95*055d4590SKeyi Gui         return 13;
96*055d4590SKeyi Gui     }
97*055d4590SKeyi Gui 
test5()98*055d4590SKeyi Gui     public static int test5() {
99*055d4590SKeyi Gui         try {
100*055d4590SKeyi Gui             call1();
101*055d4590SKeyi Gui             try {
102*055d4590SKeyi Gui                 call2();
103*055d4590SKeyi Gui                 try {
104*055d4590SKeyi Gui                     call3();
105*055d4590SKeyi Gui                 } catch (NullPointerException ex) {
106*055d4590SKeyi Gui                     return 10;
107*055d4590SKeyi Gui                 }
108*055d4590SKeyi Gui             } catch (IndexOutOfBoundsException ex) {
109*055d4590SKeyi Gui                 return 11;
110*055d4590SKeyi Gui             }
111*055d4590SKeyi Gui         } catch (RuntimeException ex) {
112*055d4590SKeyi Gui             return 12;
113*055d4590SKeyi Gui         }
114*055d4590SKeyi Gui 
115*055d4590SKeyi Gui         return 13;
116*055d4590SKeyi Gui     }
117*055d4590SKeyi Gui 
test6()118*055d4590SKeyi Gui     public static int test6() {
119*055d4590SKeyi Gui         try {
120*055d4590SKeyi Gui             try {
121*055d4590SKeyi Gui                 try {
122*055d4590SKeyi Gui                     call1();
123*055d4590SKeyi Gui                 } catch (NullPointerException ex) {
124*055d4590SKeyi Gui                     return 10;
125*055d4590SKeyi Gui                 }
126*055d4590SKeyi Gui                 call2();
127*055d4590SKeyi Gui             } catch (IndexOutOfBoundsException ex) {
128*055d4590SKeyi Gui                 return 11;
129*055d4590SKeyi Gui             }
130*055d4590SKeyi Gui             call3();
131*055d4590SKeyi Gui         } catch (RuntimeException ex) {
132*055d4590SKeyi Gui             return 12;
133*055d4590SKeyi Gui         }
134*055d4590SKeyi Gui 
135*055d4590SKeyi Gui         call4();
136*055d4590SKeyi Gui         return 13;
137*055d4590SKeyi Gui     }
138*055d4590SKeyi Gui 
test7()139*055d4590SKeyi Gui     public static int test7() {
140*055d4590SKeyi Gui         try {
141*055d4590SKeyi Gui             call1();
142*055d4590SKeyi Gui         } catch (RuntimeException ex) {
143*055d4590SKeyi Gui             return 10;
144*055d4590SKeyi Gui         }
145*055d4590SKeyi Gui 
146*055d4590SKeyi Gui         try {
147*055d4590SKeyi Gui             call2();
148*055d4590SKeyi Gui         } catch (RuntimeException ex) {
149*055d4590SKeyi Gui             return 11;
150*055d4590SKeyi Gui         }
151*055d4590SKeyi Gui 
152*055d4590SKeyi Gui         return 12;
153*055d4590SKeyi Gui     }
154*055d4590SKeyi Gui 
test8()155*055d4590SKeyi Gui     public static int test8() {
156*055d4590SKeyi Gui         try {
157*055d4590SKeyi Gui             call1();
158*055d4590SKeyi Gui             call2();
159*055d4590SKeyi Gui         } catch (RuntimeException ex) {
160*055d4590SKeyi Gui             return 10;
161*055d4590SKeyi Gui         }
162*055d4590SKeyi Gui 
163*055d4590SKeyi Gui         try {
164*055d4590SKeyi Gui             call3();
165*055d4590SKeyi Gui             call4();
166*055d4590SKeyi Gui         } catch (RuntimeException ex) {
167*055d4590SKeyi Gui             return 11;
168*055d4590SKeyi Gui         }
169*055d4590SKeyi Gui 
170*055d4590SKeyi Gui         return 12;
171*055d4590SKeyi Gui     }
172*055d4590SKeyi Gui 
test9()173*055d4590SKeyi Gui     public static int test9() {
174*055d4590SKeyi Gui         try {
175*055d4590SKeyi Gui             call1();
176*055d4590SKeyi Gui             try {
177*055d4590SKeyi Gui                 call2();
178*055d4590SKeyi Gui             } catch (IllegalArgumentException ex) {
179*055d4590SKeyi Gui                 return 10;
180*055d4590SKeyi Gui             }
181*055d4590SKeyi Gui         } catch (RuntimeException ex) {
182*055d4590SKeyi Gui             return 11;
183*055d4590SKeyi Gui         }
184*055d4590SKeyi Gui 
185*055d4590SKeyi Gui         try {
186*055d4590SKeyi Gui             call3();
187*055d4590SKeyi Gui             try {
188*055d4590SKeyi Gui                 call4();
189*055d4590SKeyi Gui             } catch (IllegalArgumentException ex) {
190*055d4590SKeyi Gui                 return 12;
191*055d4590SKeyi Gui             }
192*055d4590SKeyi Gui         } catch (RuntimeException ex) {
193*055d4590SKeyi Gui             return 13;
194*055d4590SKeyi Gui         }
195*055d4590SKeyi Gui 
196*055d4590SKeyi Gui         return 14;
197*055d4590SKeyi Gui     }
198*055d4590SKeyi Gui 
199*055d4590SKeyi Gui }
200