Home | History | Annotate | Download | only in 064-dex-array-access
      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 {
     19     public boolean test01(boolean[] x) {
     20         x[0] = true;
     21         return x[1];
     22     }
     23 
     24     public byte test02(byte[] x) {
     25         x[0] = 5;
     26         return x[1];
     27     }
     28 
     29     public short test03(short[] x) {
     30         x[0] = 5;
     31         return x[1];
     32     }
     33 
     34     public char test04(char[] x) {
     35         x[0] = 5;
     36         return x[1];
     37     }
     38 
     39     public int test05(int[] x) {
     40         x[0] = 5;
     41         return x[1];
     42     }
     43 
     44     public long test06(long[] x) {
     45         x[0] = 5;
     46         return x[1];
     47     }
     48 
     49     public float test07(float[] x) {
     50         x[0] = 2.0f;
     51         return x[1];
     52     }
     53 
     54     public double test08(double[] x) {
     55         x[0] = 2.0;
     56         return x[1];
     57     }
     58 
     59     public Object test09(Object[] x) {
     60         x[0] = null;
     61         return x[1];
     62     }
     63 
     64     public static Object test10(Object[][] x) {
     65         x[0][0] = null;
     66         return x[1][2];
     67     }
     68 
     69     public static int test11(Object x) {
     70         int[][][] arr = (int[][][]) x;
     71         arr[0][0][0] = 123;
     72         return arr[1][2][3];
     73     }
     74 }
     75