1 /* 2 * Copyright (C) 2007 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 public class Blort 18 { test01(Object x)19 public static void test01(Object x) { 20 x.hashCode(); 21 } 22 test02()23 public static Object test02() { 24 Object[] arr = null; 25 return arr[0]; 26 } 27 test03(int x)28 public static String test03(int x) { 29 String foo = null; 30 return foo; 31 } 32 test04(int x)33 public static String test04(int x) { 34 String foo = null; 35 if (x < 0) { 36 foo = "bar"; 37 } 38 return foo; 39 } 40 test05(Object x)41 public static int test05(Object x) { 42 int[] arr = (int[]) x; 43 arr[0] = 123; 44 return arr[0]; 45 } 46 test06(int x)47 public static int test06(int x) { 48 if (x < 10) { 49 int y = 1; 50 return y; 51 } else { 52 int y = 2; 53 return y; 54 } 55 } 56 57 // Test for representation of boolean. test07(boolean x)58 public static void test07(boolean x) { 59 boolean y = x; 60 } 61 62 // Test for representation of byte. test08(byte x)63 public static void test08(byte x) { 64 byte y = x; 65 } 66 67 // Test for representation of char. test09(char x)68 public static void test09(char x) { 69 char y = x; 70 } 71 72 // Test for representation of double. test10(double x)73 public static void test10(double x) { 74 double y = x; 75 } 76 77 // Test for representation of float. test11(float x)78 public static void test11(float x) { 79 float y = x; 80 } 81 82 // Test for representation of int. test12(int x)83 public static void test12(int x) { 84 int y = x; 85 } 86 87 // Test for representation of long. test13(long x)88 public static void test13(long x) { 89 long y = x; 90 } 91 92 // Test for representation of short. test14(short x)93 public static void test14(short x) { 94 short y = x; 95 } 96 97 // Test for representation of Object. test15(Object x)98 public static void test15(Object x) { 99 Object y = x; 100 } 101 102 // Test for representation of String (as a token example of a non-Object 103 // reference type). test16(String x)104 public static void test16(String x) { 105 String y = x; 106 } 107 108 // Test for representation of int[] (as a token example of an array class). test17(int[] x)109 public static void test17(int[] x) { 110 int[] y = x; 111 } 112 } 113