summaryrefslogtreecommitdiffstats
path: root/dx/tests/078-dex-local-variable-table/Blort.java
blob: 7291445db15cd13bc9100ce283f2edc99c2e3468 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
/*
 * Copyright (C) 2007 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

public class Blort
{
    public static void test01(Object x) {
        x.hashCode();
    }

    public static Object test02() {
        Object[] arr = null;
        return arr[0];
    }

    public static String test03(int x) {
        String foo = null;
        return foo;
    }

    public static String test04(int x) {
        String foo = null;
        if (x < 0) {
            foo = "bar";
        }
        return foo;
    }

    public static int test05(Object x) {
        int[] arr = (int[]) x;
        arr[0] = 123;
        return arr[0];
    }

    public static int test06(int x) {
        if (x < 10) {
            int y = 1;
            return y;
        } else {
            int y = 2;
            return y;
        }
    }

    // Test for representation of boolean.
    public static void test07(boolean x) {
        boolean y = x;
    }

    // Test for representation of byte.
    public static void test08(byte x) {
        byte y = x;
    }

    // Test for representation of char.
    public static void test09(char x) {
        char y = x;
    }

    // Test for representation of double.
    public static void test10(double x) {
        double y = x;
    }

    // Test for representation of float.
    public static void test11(float x) {
        float y = x;
    }

    // Test for representation of int.
    public static void test12(int x) {
        int y = x;
    }

    // Test for representation of long.
    public static void test13(long x) {
        long y = x;
    }

    // Test for representation of short.
    public static void test14(short x) {
        short y = x;
    }

    // Test for representation of Object.
    public static void test15(Object x) {
        Object y = x;
    }

    // Test for representation of String (as a token example of a non-Object
    // reference type).
    public static void test16(String x) {
        String y = x;
    }

    // Test for representation of int[] (as a token example of an array class).
    public static void test17(int[] x) {
        int[] y = x;
    }
}