xref: /aosp_15_r20/dalvik/dx/tests/078-dex-local-variable-table/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 {
test01(Object x)19*055d4590SKeyi Gui     public static void test01(Object x) {
20*055d4590SKeyi Gui         x.hashCode();
21*055d4590SKeyi Gui     }
22*055d4590SKeyi Gui 
test02()23*055d4590SKeyi Gui     public static Object test02() {
24*055d4590SKeyi Gui         Object[] arr = null;
25*055d4590SKeyi Gui         return arr[0];
26*055d4590SKeyi Gui     }
27*055d4590SKeyi Gui 
test03(int x)28*055d4590SKeyi Gui     public static String test03(int x) {
29*055d4590SKeyi Gui         String foo = null;
30*055d4590SKeyi Gui         return foo;
31*055d4590SKeyi Gui     }
32*055d4590SKeyi Gui 
test04(int x)33*055d4590SKeyi Gui     public static String test04(int x) {
34*055d4590SKeyi Gui         String foo = null;
35*055d4590SKeyi Gui         if (x < 0) {
36*055d4590SKeyi Gui             foo = "bar";
37*055d4590SKeyi Gui         }
38*055d4590SKeyi Gui         return foo;
39*055d4590SKeyi Gui     }
40*055d4590SKeyi Gui 
test05(Object x)41*055d4590SKeyi Gui     public static int test05(Object x) {
42*055d4590SKeyi Gui         int[] arr = (int[]) x;
43*055d4590SKeyi Gui         arr[0] = 123;
44*055d4590SKeyi Gui         return arr[0];
45*055d4590SKeyi Gui     }
46*055d4590SKeyi Gui 
test06(int x)47*055d4590SKeyi Gui     public static int test06(int x) {
48*055d4590SKeyi Gui         if (x < 10) {
49*055d4590SKeyi Gui             int y = 1;
50*055d4590SKeyi Gui             return y;
51*055d4590SKeyi Gui         } else {
52*055d4590SKeyi Gui             int y = 2;
53*055d4590SKeyi Gui             return y;
54*055d4590SKeyi Gui         }
55*055d4590SKeyi Gui     }
56*055d4590SKeyi Gui 
57*055d4590SKeyi Gui     // Test for representation of boolean.
test07(boolean x)58*055d4590SKeyi Gui     public static void test07(boolean x) {
59*055d4590SKeyi Gui         boolean y = x;
60*055d4590SKeyi Gui     }
61*055d4590SKeyi Gui 
62*055d4590SKeyi Gui     // Test for representation of byte.
test08(byte x)63*055d4590SKeyi Gui     public static void test08(byte x) {
64*055d4590SKeyi Gui         byte y = x;
65*055d4590SKeyi Gui     }
66*055d4590SKeyi Gui 
67*055d4590SKeyi Gui     // Test for representation of char.
test09(char x)68*055d4590SKeyi Gui     public static void test09(char x) {
69*055d4590SKeyi Gui         char y = x;
70*055d4590SKeyi Gui     }
71*055d4590SKeyi Gui 
72*055d4590SKeyi Gui     // Test for representation of double.
test10(double x)73*055d4590SKeyi Gui     public static void test10(double x) {
74*055d4590SKeyi Gui         double y = x;
75*055d4590SKeyi Gui     }
76*055d4590SKeyi Gui 
77*055d4590SKeyi Gui     // Test for representation of float.
test11(float x)78*055d4590SKeyi Gui     public static void test11(float x) {
79*055d4590SKeyi Gui         float y = x;
80*055d4590SKeyi Gui     }
81*055d4590SKeyi Gui 
82*055d4590SKeyi Gui     // Test for representation of int.
test12(int x)83*055d4590SKeyi Gui     public static void test12(int x) {
84*055d4590SKeyi Gui         int y = x;
85*055d4590SKeyi Gui     }
86*055d4590SKeyi Gui 
87*055d4590SKeyi Gui     // Test for representation of long.
test13(long x)88*055d4590SKeyi Gui     public static void test13(long x) {
89*055d4590SKeyi Gui         long y = x;
90*055d4590SKeyi Gui     }
91*055d4590SKeyi Gui 
92*055d4590SKeyi Gui     // Test for representation of short.
test14(short x)93*055d4590SKeyi Gui     public static void test14(short x) {
94*055d4590SKeyi Gui         short y = x;
95*055d4590SKeyi Gui     }
96*055d4590SKeyi Gui 
97*055d4590SKeyi Gui     // Test for representation of Object.
test15(Object x)98*055d4590SKeyi Gui     public static void test15(Object x) {
99*055d4590SKeyi Gui         Object y = x;
100*055d4590SKeyi Gui     }
101*055d4590SKeyi Gui 
102*055d4590SKeyi Gui     // Test for representation of String (as a token example of a non-Object
103*055d4590SKeyi Gui     // reference type).
test16(String x)104*055d4590SKeyi Gui     public static void test16(String x) {
105*055d4590SKeyi Gui         String y = x;
106*055d4590SKeyi Gui     }
107*055d4590SKeyi Gui 
108*055d4590SKeyi Gui     // Test for representation of int[] (as a token example of an array class).
test17(int[] x)109*055d4590SKeyi Gui     public static void test17(int[] x) {
110*055d4590SKeyi Gui         int[] y = x;
111*055d4590SKeyi Gui     }
112*055d4590SKeyi Gui }
113