1*795d594fSAndroid Build Coastguard Worker /* 2*795d594fSAndroid Build Coastguard Worker * Copyright (C) 2015 The Android Open Source Project 3*795d594fSAndroid Build Coastguard Worker * 4*795d594fSAndroid Build Coastguard Worker * Licensed under the Apache License, Version 2.0 (the "License"); 5*795d594fSAndroid Build Coastguard Worker * you may not use this file except in compliance with the License. 6*795d594fSAndroid Build Coastguard Worker * You may obtain a copy of the License at 7*795d594fSAndroid Build Coastguard Worker * 8*795d594fSAndroid Build Coastguard Worker * http://www.apache.org/licenses/LICENSE-2.0 9*795d594fSAndroid Build Coastguard Worker * 10*795d594fSAndroid Build Coastguard Worker * Unless required by applicable law or agreed to in writing, software 11*795d594fSAndroid Build Coastguard Worker * distributed under the License is distributed on an "AS IS" BASIS, 12*795d594fSAndroid Build Coastguard Worker * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13*795d594fSAndroid Build Coastguard Worker * See the License for the specific language governing permissions and 14*795d594fSAndroid Build Coastguard Worker * limitations under the License. 15*795d594fSAndroid Build Coastguard Worker */ 16*795d594fSAndroid Build Coastguard Worker 17*795d594fSAndroid Build Coastguard Worker public class Main { 18*795d594fSAndroid Build Coastguard Worker public static boolean doThrow = false; 19*795d594fSAndroid Build Coastguard Worker 20*795d594fSAndroid Build Coastguard Worker private Object objectField; 21*795d594fSAndroid Build Coastguard Worker private int intField; 22*795d594fSAndroid Build Coastguard Worker private float floatField; 23*795d594fSAndroid Build Coastguard Worker private long longField; 24*795d594fSAndroid Build Coastguard Worker private double doubleField; 25*795d594fSAndroid Build Coastguard Worker private byte byteField; 26*795d594fSAndroid Build Coastguard Worker private boolean booleanField; 27*795d594fSAndroid Build Coastguard Worker private char charField; 28*795d594fSAndroid Build Coastguard Worker private short shortField; 29*795d594fSAndroid Build Coastguard Worker 30*795d594fSAndroid Build Coastguard Worker private volatile Object volatileObjectField; 31*795d594fSAndroid Build Coastguard Worker private volatile int volatileIntField; 32*795d594fSAndroid Build Coastguard Worker private volatile float volatileFloatField; 33*795d594fSAndroid Build Coastguard Worker private volatile long volatileLongField; 34*795d594fSAndroid Build Coastguard Worker private volatile double volatileDoubleField; 35*795d594fSAndroid Build Coastguard Worker private volatile byte volatileByteField; 36*795d594fSAndroid Build Coastguard Worker private volatile boolean volatileBooleanField; 37*795d594fSAndroid Build Coastguard Worker private volatile char volatileCharField; 38*795d594fSAndroid Build Coastguard Worker private volatile short volatileShortField; 39*795d594fSAndroid Build Coastguard Worker $opt$noinline$setObjectField(Main m)40*795d594fSAndroid Build Coastguard Worker public static void $opt$noinline$setObjectField(Main m) { 41*795d594fSAndroid Build Coastguard Worker if (doThrow) { throw new Error(); } 42*795d594fSAndroid Build Coastguard Worker m.objectField = null; 43*795d594fSAndroid Build Coastguard Worker } 44*795d594fSAndroid Build Coastguard Worker $opt$noinline$setIntField(Main m)45*795d594fSAndroid Build Coastguard Worker public static void $opt$noinline$setIntField(Main m) { 46*795d594fSAndroid Build Coastguard Worker if (doThrow) { throw new Error(); } 47*795d594fSAndroid Build Coastguard Worker m.intField = 0; 48*795d594fSAndroid Build Coastguard Worker } 49*795d594fSAndroid Build Coastguard Worker $opt$noinline$setFloatField(Main m)50*795d594fSAndroid Build Coastguard Worker public static void $opt$noinline$setFloatField(Main m) { 51*795d594fSAndroid Build Coastguard Worker if (doThrow) { throw new Error(); } 52*795d594fSAndroid Build Coastguard Worker m.floatField = 0; 53*795d594fSAndroid Build Coastguard Worker } 54*795d594fSAndroid Build Coastguard Worker $opt$noinline$setLongField(Main m)55*795d594fSAndroid Build Coastguard Worker public static void $opt$noinline$setLongField(Main m) { 56*795d594fSAndroid Build Coastguard Worker if (doThrow) { throw new Error(); } 57*795d594fSAndroid Build Coastguard Worker m.longField = 0; 58*795d594fSAndroid Build Coastguard Worker } 59*795d594fSAndroid Build Coastguard Worker $opt$noinline$setDoubleField(Main m)60*795d594fSAndroid Build Coastguard Worker public static void $opt$noinline$setDoubleField(Main m) { 61*795d594fSAndroid Build Coastguard Worker if (doThrow) { throw new Error(); } 62*795d594fSAndroid Build Coastguard Worker m.doubleField = 0; 63*795d594fSAndroid Build Coastguard Worker } 64*795d594fSAndroid Build Coastguard Worker $opt$noinline$setByteField(Main m)65*795d594fSAndroid Build Coastguard Worker public static void $opt$noinline$setByteField(Main m) { 66*795d594fSAndroid Build Coastguard Worker if (doThrow) { throw new Error(); } 67*795d594fSAndroid Build Coastguard Worker m.byteField = 0; 68*795d594fSAndroid Build Coastguard Worker } 69*795d594fSAndroid Build Coastguard Worker $opt$noinline$setBooleanField(Main m)70*795d594fSAndroid Build Coastguard Worker public static void $opt$noinline$setBooleanField(Main m) { 71*795d594fSAndroid Build Coastguard Worker if (doThrow) { throw new Error(); } 72*795d594fSAndroid Build Coastguard Worker m.booleanField = false; 73*795d594fSAndroid Build Coastguard Worker } 74*795d594fSAndroid Build Coastguard Worker $opt$noinline$setCharField(Main m)75*795d594fSAndroid Build Coastguard Worker public static void $opt$noinline$setCharField(Main m) { 76*795d594fSAndroid Build Coastguard Worker if (doThrow) { throw new Error(); } 77*795d594fSAndroid Build Coastguard Worker m.charField = 0; 78*795d594fSAndroid Build Coastguard Worker } 79*795d594fSAndroid Build Coastguard Worker $opt$noinline$setShortField(Main m)80*795d594fSAndroid Build Coastguard Worker public static void $opt$noinline$setShortField(Main m) { 81*795d594fSAndroid Build Coastguard Worker if (doThrow) { throw new Error(); } 82*795d594fSAndroid Build Coastguard Worker m.shortField = 0; 83*795d594fSAndroid Build Coastguard Worker } 84*795d594fSAndroid Build Coastguard Worker $opt$noinline$getObjectField(Main m)85*795d594fSAndroid Build Coastguard Worker public static Object $opt$noinline$getObjectField(Main m) { 86*795d594fSAndroid Build Coastguard Worker if (doThrow) { throw new Error(); } 87*795d594fSAndroid Build Coastguard Worker return m.objectField; 88*795d594fSAndroid Build Coastguard Worker } 89*795d594fSAndroid Build Coastguard Worker $opt$noinline$getIntField(Main m)90*795d594fSAndroid Build Coastguard Worker public static int $opt$noinline$getIntField(Main m) { 91*795d594fSAndroid Build Coastguard Worker if (doThrow) { throw new Error(); } 92*795d594fSAndroid Build Coastguard Worker return m.intField; 93*795d594fSAndroid Build Coastguard Worker } 94*795d594fSAndroid Build Coastguard Worker $opt$noinline$getFloatField(Main m)95*795d594fSAndroid Build Coastguard Worker public static float $opt$noinline$getFloatField(Main m) { 96*795d594fSAndroid Build Coastguard Worker if (doThrow) { throw new Error(); } 97*795d594fSAndroid Build Coastguard Worker return m.floatField; 98*795d594fSAndroid Build Coastguard Worker } 99*795d594fSAndroid Build Coastguard Worker $opt$noinline$getLongField(Main m)100*795d594fSAndroid Build Coastguard Worker public static long $opt$noinline$getLongField(Main m) { 101*795d594fSAndroid Build Coastguard Worker if (doThrow) { throw new Error(); } 102*795d594fSAndroid Build Coastguard Worker return m.longField; 103*795d594fSAndroid Build Coastguard Worker } 104*795d594fSAndroid Build Coastguard Worker $opt$noinline$getDoubleField(Main m)105*795d594fSAndroid Build Coastguard Worker public static double $opt$noinline$getDoubleField(Main m) { 106*795d594fSAndroid Build Coastguard Worker if (doThrow) { throw new Error(); } 107*795d594fSAndroid Build Coastguard Worker return m.doubleField; 108*795d594fSAndroid Build Coastguard Worker } 109*795d594fSAndroid Build Coastguard Worker $opt$noinline$getByteField(Main m)110*795d594fSAndroid Build Coastguard Worker public static byte $opt$noinline$getByteField(Main m) { 111*795d594fSAndroid Build Coastguard Worker if (doThrow) { throw new Error(); } 112*795d594fSAndroid Build Coastguard Worker return m.byteField; 113*795d594fSAndroid Build Coastguard Worker } 114*795d594fSAndroid Build Coastguard Worker $opt$noinline$getBooleanField(Main m)115*795d594fSAndroid Build Coastguard Worker public static boolean $opt$noinline$getBooleanField(Main m) { 116*795d594fSAndroid Build Coastguard Worker if (doThrow) { throw new Error(); } 117*795d594fSAndroid Build Coastguard Worker return m.booleanField; 118*795d594fSAndroid Build Coastguard Worker } 119*795d594fSAndroid Build Coastguard Worker $opt$noinline$getCharField(Main m)120*795d594fSAndroid Build Coastguard Worker public static char $opt$noinline$getCharField(Main m) { 121*795d594fSAndroid Build Coastguard Worker if (doThrow) { throw new Error(); } 122*795d594fSAndroid Build Coastguard Worker return m.charField; 123*795d594fSAndroid Build Coastguard Worker } 124*795d594fSAndroid Build Coastguard Worker $opt$noinline$getShortField(Main m)125*795d594fSAndroid Build Coastguard Worker public static short $opt$noinline$getShortField(Main m) { 126*795d594fSAndroid Build Coastguard Worker if (doThrow) { throw new Error(); } 127*795d594fSAndroid Build Coastguard Worker return m.shortField; 128*795d594fSAndroid Build Coastguard Worker } 129*795d594fSAndroid Build Coastguard Worker $opt$noinline$setVolatileObjectField(Main m)130*795d594fSAndroid Build Coastguard Worker public static void $opt$noinline$setVolatileObjectField(Main m) { 131*795d594fSAndroid Build Coastguard Worker if (doThrow) { throw new Error(); } 132*795d594fSAndroid Build Coastguard Worker m.volatileObjectField = null; 133*795d594fSAndroid Build Coastguard Worker } 134*795d594fSAndroid Build Coastguard Worker $opt$noinline$setVolatileIntField(Main m)135*795d594fSAndroid Build Coastguard Worker public static void $opt$noinline$setVolatileIntField(Main m) { 136*795d594fSAndroid Build Coastguard Worker if (doThrow) { throw new Error(); } 137*795d594fSAndroid Build Coastguard Worker m.volatileIntField = 0; 138*795d594fSAndroid Build Coastguard Worker } 139*795d594fSAndroid Build Coastguard Worker $opt$noinline$setVolatileFloatField(Main m)140*795d594fSAndroid Build Coastguard Worker public static void $opt$noinline$setVolatileFloatField(Main m) { 141*795d594fSAndroid Build Coastguard Worker if (doThrow) { throw new Error(); } 142*795d594fSAndroid Build Coastguard Worker m.volatileFloatField = 0; 143*795d594fSAndroid Build Coastguard Worker } 144*795d594fSAndroid Build Coastguard Worker $opt$noinline$setVolatileLongField(Main m)145*795d594fSAndroid Build Coastguard Worker public static void $opt$noinline$setVolatileLongField(Main m) { 146*795d594fSAndroid Build Coastguard Worker if (doThrow) { throw new Error(); } 147*795d594fSAndroid Build Coastguard Worker m.volatileLongField = 0; 148*795d594fSAndroid Build Coastguard Worker } 149*795d594fSAndroid Build Coastguard Worker $opt$noinline$setVolatileDoubleField(Main m)150*795d594fSAndroid Build Coastguard Worker public static void $opt$noinline$setVolatileDoubleField(Main m) { 151*795d594fSAndroid Build Coastguard Worker if (doThrow) { throw new Error(); } 152*795d594fSAndroid Build Coastguard Worker m.volatileDoubleField = 0; 153*795d594fSAndroid Build Coastguard Worker } 154*795d594fSAndroid Build Coastguard Worker $opt$noinline$setVolatileByteField(Main m)155*795d594fSAndroid Build Coastguard Worker public static void $opt$noinline$setVolatileByteField(Main m) { 156*795d594fSAndroid Build Coastguard Worker if (doThrow) { throw new Error(); } 157*795d594fSAndroid Build Coastguard Worker m.volatileByteField = 0; 158*795d594fSAndroid Build Coastguard Worker } 159*795d594fSAndroid Build Coastguard Worker $opt$noinline$setVolatileBooleanField(Main m)160*795d594fSAndroid Build Coastguard Worker public static void $opt$noinline$setVolatileBooleanField(Main m) { 161*795d594fSAndroid Build Coastguard Worker if (doThrow) { throw new Error(); } 162*795d594fSAndroid Build Coastguard Worker m.volatileBooleanField = false; 163*795d594fSAndroid Build Coastguard Worker } 164*795d594fSAndroid Build Coastguard Worker $opt$noinline$setVolatileCharField(Main m)165*795d594fSAndroid Build Coastguard Worker public static void $opt$noinline$setVolatileCharField(Main m) { 166*795d594fSAndroid Build Coastguard Worker if (doThrow) { throw new Error(); } 167*795d594fSAndroid Build Coastguard Worker m.volatileCharField = 0; 168*795d594fSAndroid Build Coastguard Worker } 169*795d594fSAndroid Build Coastguard Worker $opt$noinline$setVolatileShortField(Main m)170*795d594fSAndroid Build Coastguard Worker public static void $opt$noinline$setVolatileShortField(Main m) { 171*795d594fSAndroid Build Coastguard Worker if (doThrow) { throw new Error(); } 172*795d594fSAndroid Build Coastguard Worker m.volatileShortField = 0; 173*795d594fSAndroid Build Coastguard Worker } 174*795d594fSAndroid Build Coastguard Worker $opt$noinline$getVolatileObjectField(Main m)175*795d594fSAndroid Build Coastguard Worker public static Object $opt$noinline$getVolatileObjectField(Main m) { 176*795d594fSAndroid Build Coastguard Worker if (doThrow) { throw new Error(); } 177*795d594fSAndroid Build Coastguard Worker return m.volatileObjectField; 178*795d594fSAndroid Build Coastguard Worker } 179*795d594fSAndroid Build Coastguard Worker $opt$noinline$getVolatileIntField(Main m)180*795d594fSAndroid Build Coastguard Worker public static int $opt$noinline$getVolatileIntField(Main m) { 181*795d594fSAndroid Build Coastguard Worker if (doThrow) { throw new Error(); } 182*795d594fSAndroid Build Coastguard Worker return m.volatileIntField; 183*795d594fSAndroid Build Coastguard Worker } 184*795d594fSAndroid Build Coastguard Worker $opt$noinline$getVolatileFloatField(Main m)185*795d594fSAndroid Build Coastguard Worker public static float $opt$noinline$getVolatileFloatField(Main m) { 186*795d594fSAndroid Build Coastguard Worker if (doThrow) { throw new Error(); } 187*795d594fSAndroid Build Coastguard Worker return m.volatileFloatField; 188*795d594fSAndroid Build Coastguard Worker } 189*795d594fSAndroid Build Coastguard Worker $opt$noinline$getVolatileLongField(Main m)190*795d594fSAndroid Build Coastguard Worker public static long $opt$noinline$getVolatileLongField(Main m) { 191*795d594fSAndroid Build Coastguard Worker if (doThrow) { throw new Error(); } 192*795d594fSAndroid Build Coastguard Worker return m.volatileLongField; 193*795d594fSAndroid Build Coastguard Worker } 194*795d594fSAndroid Build Coastguard Worker $opt$noinline$getVolatileDoubleField(Main m)195*795d594fSAndroid Build Coastguard Worker public static double $opt$noinline$getVolatileDoubleField(Main m) { 196*795d594fSAndroid Build Coastguard Worker if (doThrow) { throw new Error(); } 197*795d594fSAndroid Build Coastguard Worker return m.volatileDoubleField; 198*795d594fSAndroid Build Coastguard Worker } 199*795d594fSAndroid Build Coastguard Worker $opt$noinline$getVolatileByteField(Main m)200*795d594fSAndroid Build Coastguard Worker public static byte $opt$noinline$getVolatileByteField(Main m) { 201*795d594fSAndroid Build Coastguard Worker if (doThrow) { throw new Error(); } 202*795d594fSAndroid Build Coastguard Worker return m.volatileByteField; 203*795d594fSAndroid Build Coastguard Worker } 204*795d594fSAndroid Build Coastguard Worker $opt$noinline$getVolatileBooleanField(Main m)205*795d594fSAndroid Build Coastguard Worker public static boolean $opt$noinline$getVolatileBooleanField(Main m) { 206*795d594fSAndroid Build Coastguard Worker if (doThrow) { throw new Error(); } 207*795d594fSAndroid Build Coastguard Worker return m.volatileBooleanField; 208*795d594fSAndroid Build Coastguard Worker } 209*795d594fSAndroid Build Coastguard Worker $opt$noinline$getVolatileCharField(Main m)210*795d594fSAndroid Build Coastguard Worker public static char $opt$noinline$getVolatileCharField(Main m) { 211*795d594fSAndroid Build Coastguard Worker if (doThrow) { throw new Error(); } 212*795d594fSAndroid Build Coastguard Worker return m.volatileCharField; 213*795d594fSAndroid Build Coastguard Worker } 214*795d594fSAndroid Build Coastguard Worker $opt$noinline$getVolatileShortField(Main m)215*795d594fSAndroid Build Coastguard Worker public static short $opt$noinline$getVolatileShortField(Main m) { 216*795d594fSAndroid Build Coastguard Worker if (doThrow) { throw new Error(); } 217*795d594fSAndroid Build Coastguard Worker return m.volatileShortField; 218*795d594fSAndroid Build Coastguard Worker } 219*795d594fSAndroid Build Coastguard Worker $opt$noinline$setObjectElement(Object[] a)220*795d594fSAndroid Build Coastguard Worker public static void $opt$noinline$setObjectElement(Object[] a) { 221*795d594fSAndroid Build Coastguard Worker if (doThrow) { throw new Error(); } 222*795d594fSAndroid Build Coastguard Worker a[0] = null; 223*795d594fSAndroid Build Coastguard Worker } 224*795d594fSAndroid Build Coastguard Worker $opt$noinline$setIntElement(int[] a)225*795d594fSAndroid Build Coastguard Worker public static void $opt$noinline$setIntElement(int[] a) { 226*795d594fSAndroid Build Coastguard Worker if (doThrow) { throw new Error(); } 227*795d594fSAndroid Build Coastguard Worker a[0] = 0; 228*795d594fSAndroid Build Coastguard Worker } 229*795d594fSAndroid Build Coastguard Worker $opt$noinline$setFloatElement(float[] a)230*795d594fSAndroid Build Coastguard Worker public static void $opt$noinline$setFloatElement(float[] a) { 231*795d594fSAndroid Build Coastguard Worker if (doThrow) { throw new Error(); } 232*795d594fSAndroid Build Coastguard Worker a[0] = 0; 233*795d594fSAndroid Build Coastguard Worker } 234*795d594fSAndroid Build Coastguard Worker $opt$noinline$setLongElement(long[] a)235*795d594fSAndroid Build Coastguard Worker public static void $opt$noinline$setLongElement(long[] a) { 236*795d594fSAndroid Build Coastguard Worker if (doThrow) { throw new Error(); } 237*795d594fSAndroid Build Coastguard Worker a[0] = 0; 238*795d594fSAndroid Build Coastguard Worker } 239*795d594fSAndroid Build Coastguard Worker $opt$noinline$setDoubleElement(double[] a)240*795d594fSAndroid Build Coastguard Worker public static void $opt$noinline$setDoubleElement(double[] a) { 241*795d594fSAndroid Build Coastguard Worker if (doThrow) { throw new Error(); } 242*795d594fSAndroid Build Coastguard Worker a[0] = 0; 243*795d594fSAndroid Build Coastguard Worker } 244*795d594fSAndroid Build Coastguard Worker $opt$noinline$setByteElement(byte[] a)245*795d594fSAndroid Build Coastguard Worker public static void $opt$noinline$setByteElement(byte[] a) { 246*795d594fSAndroid Build Coastguard Worker if (doThrow) { throw new Error(); } 247*795d594fSAndroid Build Coastguard Worker a[0] = 0; 248*795d594fSAndroid Build Coastguard Worker } 249*795d594fSAndroid Build Coastguard Worker $opt$noinline$setBooleanElement(boolean[] a)250*795d594fSAndroid Build Coastguard Worker public static void $opt$noinline$setBooleanElement(boolean[] a) { 251*795d594fSAndroid Build Coastguard Worker if (doThrow) { throw new Error(); } 252*795d594fSAndroid Build Coastguard Worker a[0] = false; 253*795d594fSAndroid Build Coastguard Worker } 254*795d594fSAndroid Build Coastguard Worker $opt$noinline$setCharElement(char[] a)255*795d594fSAndroid Build Coastguard Worker public static void $opt$noinline$setCharElement(char[] a) { 256*795d594fSAndroid Build Coastguard Worker if (doThrow) { throw new Error(); } 257*795d594fSAndroid Build Coastguard Worker a[0] = 0; 258*795d594fSAndroid Build Coastguard Worker } 259*795d594fSAndroid Build Coastguard Worker $opt$noinline$setShortElement(short[] a)260*795d594fSAndroid Build Coastguard Worker public static void $opt$noinline$setShortElement(short[] a) { 261*795d594fSAndroid Build Coastguard Worker if (doThrow) { throw new Error(); } 262*795d594fSAndroid Build Coastguard Worker a[0] = 0; 263*795d594fSAndroid Build Coastguard Worker } 264*795d594fSAndroid Build Coastguard Worker $opt$noinline$getObjectElement(Object[] a)265*795d594fSAndroid Build Coastguard Worker public static Object $opt$noinline$getObjectElement(Object[] a) { 266*795d594fSAndroid Build Coastguard Worker if (doThrow) { throw new Error(); } 267*795d594fSAndroid Build Coastguard Worker return a[0]; 268*795d594fSAndroid Build Coastguard Worker } 269*795d594fSAndroid Build Coastguard Worker $opt$noinline$getIntElement(int[] a)270*795d594fSAndroid Build Coastguard Worker public static int $opt$noinline$getIntElement(int[] a) { 271*795d594fSAndroid Build Coastguard Worker if (doThrow) { throw new Error(); } 272*795d594fSAndroid Build Coastguard Worker return a[0]; 273*795d594fSAndroid Build Coastguard Worker } 274*795d594fSAndroid Build Coastguard Worker $opt$noinline$getFloatElement(float[] a)275*795d594fSAndroid Build Coastguard Worker public static float $opt$noinline$getFloatElement(float[] a) { 276*795d594fSAndroid Build Coastguard Worker if (doThrow) { throw new Error(); } 277*795d594fSAndroid Build Coastguard Worker return a[0]; 278*795d594fSAndroid Build Coastguard Worker } 279*795d594fSAndroid Build Coastguard Worker $opt$noinline$getLongElement(long[] a)280*795d594fSAndroid Build Coastguard Worker public static long $opt$noinline$getLongElement(long[] a) { 281*795d594fSAndroid Build Coastguard Worker if (doThrow) { throw new Error(); } 282*795d594fSAndroid Build Coastguard Worker return a[0]; 283*795d594fSAndroid Build Coastguard Worker } 284*795d594fSAndroid Build Coastguard Worker $opt$noinline$getDoubleElement(double[] a)285*795d594fSAndroid Build Coastguard Worker public static double $opt$noinline$getDoubleElement(double[] a) { 286*795d594fSAndroid Build Coastguard Worker if (doThrow) { throw new Error(); } 287*795d594fSAndroid Build Coastguard Worker return a[0]; 288*795d594fSAndroid Build Coastguard Worker } 289*795d594fSAndroid Build Coastguard Worker $opt$noinline$getByteElement(byte[] a)290*795d594fSAndroid Build Coastguard Worker public static byte $opt$noinline$getByteElement(byte[] a) { 291*795d594fSAndroid Build Coastguard Worker if (doThrow) { throw new Error(); } 292*795d594fSAndroid Build Coastguard Worker return a[0]; 293*795d594fSAndroid Build Coastguard Worker } 294*795d594fSAndroid Build Coastguard Worker $opt$noinline$getBooleanElement(boolean[] a)295*795d594fSAndroid Build Coastguard Worker public static boolean $opt$noinline$getBooleanElement(boolean[] a) { 296*795d594fSAndroid Build Coastguard Worker if (doThrow) { throw new Error(); } 297*795d594fSAndroid Build Coastguard Worker return a[0]; 298*795d594fSAndroid Build Coastguard Worker } 299*795d594fSAndroid Build Coastguard Worker $opt$noinline$getCharElement(char[] a)300*795d594fSAndroid Build Coastguard Worker public static char $opt$noinline$getCharElement(char[] a) { 301*795d594fSAndroid Build Coastguard Worker if (doThrow) { throw new Error(); } 302*795d594fSAndroid Build Coastguard Worker return a[0]; 303*795d594fSAndroid Build Coastguard Worker } 304*795d594fSAndroid Build Coastguard Worker $opt$noinline$getShortElement(short[] a)305*795d594fSAndroid Build Coastguard Worker public static short $opt$noinline$getShortElement(short[] a) { 306*795d594fSAndroid Build Coastguard Worker if (doThrow) { throw new Error(); } 307*795d594fSAndroid Build Coastguard Worker return a[0]; 308*795d594fSAndroid Build Coastguard Worker } 309*795d594fSAndroid Build Coastguard Worker main(String[] args)310*795d594fSAndroid Build Coastguard Worker public static void main(String[] args) { 311*795d594fSAndroid Build Coastguard Worker int methodLine = 42; 312*795d594fSAndroid Build Coastguard Worker int thisLine = 312; 313*795d594fSAndroid Build Coastguard Worker try { 314*795d594fSAndroid Build Coastguard Worker $opt$noinline$setObjectField(null); 315*795d594fSAndroid Build Coastguard Worker throw new RuntimeException("Failed to throw NullPointerException."); 316*795d594fSAndroid Build Coastguard Worker } catch (NullPointerException npe) { 317*795d594fSAndroid Build Coastguard Worker check(npe, thisLine += 2, methodLine, "$opt$noinline$setObjectField"); 318*795d594fSAndroid Build Coastguard Worker } 319*795d594fSAndroid Build Coastguard Worker try { 320*795d594fSAndroid Build Coastguard Worker $opt$noinline$setIntField(null); 321*795d594fSAndroid Build Coastguard Worker throw new RuntimeException("Failed to throw NullPointerException."); 322*795d594fSAndroid Build Coastguard Worker } catch (NullPointerException npe) { 323*795d594fSAndroid Build Coastguard Worker check(npe, thisLine += 6, methodLine += 5, "$opt$noinline$setIntField"); 324*795d594fSAndroid Build Coastguard Worker } 325*795d594fSAndroid Build Coastguard Worker try { 326*795d594fSAndroid Build Coastguard Worker $opt$noinline$setFloatField(null); 327*795d594fSAndroid Build Coastguard Worker throw new RuntimeException("Failed to throw NullPointerException."); 328*795d594fSAndroid Build Coastguard Worker } catch (NullPointerException npe) { 329*795d594fSAndroid Build Coastguard Worker check(npe, thisLine += 6, methodLine += 5, "$opt$noinline$setFloatField"); 330*795d594fSAndroid Build Coastguard Worker } 331*795d594fSAndroid Build Coastguard Worker try { 332*795d594fSAndroid Build Coastguard Worker $opt$noinline$setLongField(null); 333*795d594fSAndroid Build Coastguard Worker throw new RuntimeException("Failed to throw NullPointerException."); 334*795d594fSAndroid Build Coastguard Worker } catch (NullPointerException npe) { 335*795d594fSAndroid Build Coastguard Worker check(npe, thisLine += 6, methodLine += 5, "$opt$noinline$setLongField"); 336*795d594fSAndroid Build Coastguard Worker } 337*795d594fSAndroid Build Coastguard Worker try { 338*795d594fSAndroid Build Coastguard Worker $opt$noinline$setDoubleField(null); 339*795d594fSAndroid Build Coastguard Worker throw new RuntimeException("Failed to throw NullPointerException."); 340*795d594fSAndroid Build Coastguard Worker } catch (NullPointerException npe) { 341*795d594fSAndroid Build Coastguard Worker check(npe, thisLine += 6, methodLine += 5, "$opt$noinline$setDoubleField"); 342*795d594fSAndroid Build Coastguard Worker } 343*795d594fSAndroid Build Coastguard Worker try { 344*795d594fSAndroid Build Coastguard Worker $opt$noinline$setByteField(null); 345*795d594fSAndroid Build Coastguard Worker throw new RuntimeException("Failed to throw NullPointerException."); 346*795d594fSAndroid Build Coastguard Worker } catch (NullPointerException npe) { 347*795d594fSAndroid Build Coastguard Worker check(npe, thisLine += 6, methodLine += 5, "$opt$noinline$setByteField"); 348*795d594fSAndroid Build Coastguard Worker } 349*795d594fSAndroid Build Coastguard Worker try { 350*795d594fSAndroid Build Coastguard Worker $opt$noinline$setBooleanField(null); 351*795d594fSAndroid Build Coastguard Worker throw new RuntimeException("Failed to throw NullPointerException."); 352*795d594fSAndroid Build Coastguard Worker } catch (NullPointerException npe) { 353*795d594fSAndroid Build Coastguard Worker check(npe, thisLine += 6, methodLine += 5, "$opt$noinline$setBooleanField"); 354*795d594fSAndroid Build Coastguard Worker } 355*795d594fSAndroid Build Coastguard Worker try { 356*795d594fSAndroid Build Coastguard Worker $opt$noinline$setCharField(null); 357*795d594fSAndroid Build Coastguard Worker throw new RuntimeException("Failed to throw NullPointerException."); 358*795d594fSAndroid Build Coastguard Worker } catch (NullPointerException npe) { 359*795d594fSAndroid Build Coastguard Worker check(npe, thisLine += 6, methodLine += 5, "$opt$noinline$setCharField"); 360*795d594fSAndroid Build Coastguard Worker } 361*795d594fSAndroid Build Coastguard Worker try { 362*795d594fSAndroid Build Coastguard Worker $opt$noinline$setShortField(null); 363*795d594fSAndroid Build Coastguard Worker throw new RuntimeException("Failed to throw NullPointerException."); 364*795d594fSAndroid Build Coastguard Worker } catch (NullPointerException npe) { 365*795d594fSAndroid Build Coastguard Worker check(npe, thisLine += 6, methodLine += 5, "$opt$noinline$setShortField"); 366*795d594fSAndroid Build Coastguard Worker } 367*795d594fSAndroid Build Coastguard Worker try { 368*795d594fSAndroid Build Coastguard Worker $opt$noinline$getObjectField(null); 369*795d594fSAndroid Build Coastguard Worker throw new RuntimeException("Failed to throw NullPointerException."); 370*795d594fSAndroid Build Coastguard Worker } catch (NullPointerException npe) { 371*795d594fSAndroid Build Coastguard Worker check(npe, thisLine += 6, methodLine += 5, "$opt$noinline$getObjectField"); 372*795d594fSAndroid Build Coastguard Worker } 373*795d594fSAndroid Build Coastguard Worker try { 374*795d594fSAndroid Build Coastguard Worker $opt$noinline$getIntField(null); 375*795d594fSAndroid Build Coastguard Worker throw new RuntimeException("Failed to throw NullPointerException."); 376*795d594fSAndroid Build Coastguard Worker } catch (NullPointerException npe) { 377*795d594fSAndroid Build Coastguard Worker check(npe, thisLine += 6, methodLine += 5, "$opt$noinline$getIntField"); 378*795d594fSAndroid Build Coastguard Worker } 379*795d594fSAndroid Build Coastguard Worker try { 380*795d594fSAndroid Build Coastguard Worker $opt$noinline$getFloatField(null); 381*795d594fSAndroid Build Coastguard Worker throw new RuntimeException("Failed to throw NullPointerException."); 382*795d594fSAndroid Build Coastguard Worker } catch (NullPointerException npe) { 383*795d594fSAndroid Build Coastguard Worker check(npe, thisLine += 6, methodLine += 5, "$opt$noinline$getFloatField"); 384*795d594fSAndroid Build Coastguard Worker } 385*795d594fSAndroid Build Coastguard Worker try { 386*795d594fSAndroid Build Coastguard Worker $opt$noinline$getLongField(null); 387*795d594fSAndroid Build Coastguard Worker throw new RuntimeException("Failed to throw NullPointerException."); 388*795d594fSAndroid Build Coastguard Worker } catch (NullPointerException npe) { 389*795d594fSAndroid Build Coastguard Worker check(npe, thisLine += 6, methodLine += 5, "$opt$noinline$getLongField"); 390*795d594fSAndroid Build Coastguard Worker } 391*795d594fSAndroid Build Coastguard Worker try { 392*795d594fSAndroid Build Coastguard Worker $opt$noinline$getDoubleField(null); 393*795d594fSAndroid Build Coastguard Worker throw new RuntimeException("Failed to throw NullPointerException."); 394*795d594fSAndroid Build Coastguard Worker } catch (NullPointerException npe) { 395*795d594fSAndroid Build Coastguard Worker check(npe, thisLine += 6, methodLine += 5, "$opt$noinline$getDoubleField"); 396*795d594fSAndroid Build Coastguard Worker } 397*795d594fSAndroid Build Coastguard Worker try { 398*795d594fSAndroid Build Coastguard Worker $opt$noinline$getByteField(null); 399*795d594fSAndroid Build Coastguard Worker throw new RuntimeException("Failed to throw NullPointerException."); 400*795d594fSAndroid Build Coastguard Worker } catch (NullPointerException npe) { 401*795d594fSAndroid Build Coastguard Worker check(npe, thisLine += 6, methodLine += 5, "$opt$noinline$getByteField"); 402*795d594fSAndroid Build Coastguard Worker } 403*795d594fSAndroid Build Coastguard Worker try { 404*795d594fSAndroid Build Coastguard Worker $opt$noinline$getBooleanField(null); 405*795d594fSAndroid Build Coastguard Worker throw new RuntimeException("Failed to throw NullPointerException."); 406*795d594fSAndroid Build Coastguard Worker } catch (NullPointerException npe) { 407*795d594fSAndroid Build Coastguard Worker check(npe, thisLine += 6, methodLine += 5, "$opt$noinline$getBooleanField"); 408*795d594fSAndroid Build Coastguard Worker } 409*795d594fSAndroid Build Coastguard Worker try { 410*795d594fSAndroid Build Coastguard Worker $opt$noinline$getCharField(null); 411*795d594fSAndroid Build Coastguard Worker throw new RuntimeException("Failed to throw NullPointerException."); 412*795d594fSAndroid Build Coastguard Worker } catch (NullPointerException npe) { 413*795d594fSAndroid Build Coastguard Worker check(npe, thisLine += 6, methodLine += 5, "$opt$noinline$getCharField"); 414*795d594fSAndroid Build Coastguard Worker } 415*795d594fSAndroid Build Coastguard Worker try { 416*795d594fSAndroid Build Coastguard Worker $opt$noinline$getShortField(null); 417*795d594fSAndroid Build Coastguard Worker throw new RuntimeException("Failed to throw NullPointerException."); 418*795d594fSAndroid Build Coastguard Worker } catch (NullPointerException npe) { 419*795d594fSAndroid Build Coastguard Worker check(npe, thisLine += 6, methodLine += 5, "$opt$noinline$getShortField"); 420*795d594fSAndroid Build Coastguard Worker } 421*795d594fSAndroid Build Coastguard Worker try { 422*795d594fSAndroid Build Coastguard Worker $opt$noinline$setVolatileObjectField(null); 423*795d594fSAndroid Build Coastguard Worker throw new RuntimeException("Failed to throw NullPointerException."); 424*795d594fSAndroid Build Coastguard Worker } catch (NullPointerException npe) { 425*795d594fSAndroid Build Coastguard Worker check(npe, thisLine += 6, methodLine += 5, "$opt$noinline$setVolatileObjectField"); 426*795d594fSAndroid Build Coastguard Worker } 427*795d594fSAndroid Build Coastguard Worker try { 428*795d594fSAndroid Build Coastguard Worker $opt$noinline$setVolatileIntField(null); 429*795d594fSAndroid Build Coastguard Worker throw new RuntimeException("Failed to throw NullPointerException."); 430*795d594fSAndroid Build Coastguard Worker } catch (NullPointerException npe) { 431*795d594fSAndroid Build Coastguard Worker check(npe, thisLine += 6, methodLine += 5, "$opt$noinline$setVolatileIntField"); 432*795d594fSAndroid Build Coastguard Worker } 433*795d594fSAndroid Build Coastguard Worker try { 434*795d594fSAndroid Build Coastguard Worker $opt$noinline$setVolatileFloatField(null); 435*795d594fSAndroid Build Coastguard Worker throw new RuntimeException("Failed to throw NullPointerException."); 436*795d594fSAndroid Build Coastguard Worker } catch (NullPointerException npe) { 437*795d594fSAndroid Build Coastguard Worker check(npe, thisLine += 6, methodLine += 5, "$opt$noinline$setVolatileFloatField"); 438*795d594fSAndroid Build Coastguard Worker } 439*795d594fSAndroid Build Coastguard Worker try { 440*795d594fSAndroid Build Coastguard Worker $opt$noinline$setVolatileLongField(null); 441*795d594fSAndroid Build Coastguard Worker throw new RuntimeException("Failed to throw NullPointerException."); 442*795d594fSAndroid Build Coastguard Worker } catch (NullPointerException npe) { 443*795d594fSAndroid Build Coastguard Worker check(npe, thisLine += 6, methodLine += 5, "$opt$noinline$setVolatileLongField"); 444*795d594fSAndroid Build Coastguard Worker } 445*795d594fSAndroid Build Coastguard Worker try { 446*795d594fSAndroid Build Coastguard Worker $opt$noinline$setVolatileDoubleField(null); 447*795d594fSAndroid Build Coastguard Worker throw new RuntimeException("Failed to throw NullPointerException."); 448*795d594fSAndroid Build Coastguard Worker } catch (NullPointerException npe) { 449*795d594fSAndroid Build Coastguard Worker check(npe, thisLine += 6, methodLine += 5, "$opt$noinline$setVolatileDoubleField"); 450*795d594fSAndroid Build Coastguard Worker } 451*795d594fSAndroid Build Coastguard Worker try { 452*795d594fSAndroid Build Coastguard Worker $opt$noinline$setVolatileByteField(null); 453*795d594fSAndroid Build Coastguard Worker throw new RuntimeException("Failed to throw NullPointerException."); 454*795d594fSAndroid Build Coastguard Worker } catch (NullPointerException npe) { 455*795d594fSAndroid Build Coastguard Worker check(npe, thisLine += 6, methodLine += 5, "$opt$noinline$setVolatileByteField"); 456*795d594fSAndroid Build Coastguard Worker } 457*795d594fSAndroid Build Coastguard Worker try { 458*795d594fSAndroid Build Coastguard Worker $opt$noinline$setVolatileBooleanField(null); 459*795d594fSAndroid Build Coastguard Worker throw new RuntimeException("Failed to throw NullPointerException."); 460*795d594fSAndroid Build Coastguard Worker } catch (NullPointerException npe) { 461*795d594fSAndroid Build Coastguard Worker check(npe, thisLine += 6, methodLine += 5, "$opt$noinline$setVolatileBooleanField"); 462*795d594fSAndroid Build Coastguard Worker } 463*795d594fSAndroid Build Coastguard Worker try { 464*795d594fSAndroid Build Coastguard Worker $opt$noinline$setVolatileCharField(null); 465*795d594fSAndroid Build Coastguard Worker throw new RuntimeException("Failed to throw NullPointerException."); 466*795d594fSAndroid Build Coastguard Worker } catch (NullPointerException npe) { 467*795d594fSAndroid Build Coastguard Worker check(npe, thisLine += 6, methodLine += 5, "$opt$noinline$setVolatileCharField"); 468*795d594fSAndroid Build Coastguard Worker } 469*795d594fSAndroid Build Coastguard Worker try { 470*795d594fSAndroid Build Coastguard Worker $opt$noinline$setVolatileShortField(null); 471*795d594fSAndroid Build Coastguard Worker throw new RuntimeException("Failed to throw NullPointerException."); 472*795d594fSAndroid Build Coastguard Worker } catch (NullPointerException npe) { 473*795d594fSAndroid Build Coastguard Worker check(npe, thisLine += 6, methodLine += 5, "$opt$noinline$setVolatileShortField"); 474*795d594fSAndroid Build Coastguard Worker } 475*795d594fSAndroid Build Coastguard Worker try { 476*795d594fSAndroid Build Coastguard Worker $opt$noinline$getVolatileObjectField(null); 477*795d594fSAndroid Build Coastguard Worker throw new RuntimeException("Failed to throw NullPointerException."); 478*795d594fSAndroid Build Coastguard Worker } catch (NullPointerException npe) { 479*795d594fSAndroid Build Coastguard Worker check(npe, thisLine += 6, methodLine += 5, "$opt$noinline$getVolatileObjectField"); 480*795d594fSAndroid Build Coastguard Worker } 481*795d594fSAndroid Build Coastguard Worker try { 482*795d594fSAndroid Build Coastguard Worker $opt$noinline$getVolatileIntField(null); 483*795d594fSAndroid Build Coastguard Worker throw new RuntimeException("Failed to throw NullPointerException."); 484*795d594fSAndroid Build Coastguard Worker } catch (NullPointerException npe) { 485*795d594fSAndroid Build Coastguard Worker check(npe, thisLine += 6, methodLine += 5, "$opt$noinline$getVolatileIntField"); 486*795d594fSAndroid Build Coastguard Worker } 487*795d594fSAndroid Build Coastguard Worker try { 488*795d594fSAndroid Build Coastguard Worker $opt$noinline$getVolatileFloatField(null); 489*795d594fSAndroid Build Coastguard Worker throw new RuntimeException("Failed to throw NullPointerException."); 490*795d594fSAndroid Build Coastguard Worker } catch (NullPointerException npe) { 491*795d594fSAndroid Build Coastguard Worker check(npe, thisLine += 6, methodLine += 5, "$opt$noinline$getVolatileFloatField"); 492*795d594fSAndroid Build Coastguard Worker } 493*795d594fSAndroid Build Coastguard Worker try { 494*795d594fSAndroid Build Coastguard Worker $opt$noinline$getVolatileLongField(null); 495*795d594fSAndroid Build Coastguard Worker throw new RuntimeException("Failed to throw NullPointerException."); 496*795d594fSAndroid Build Coastguard Worker } catch (NullPointerException npe) { 497*795d594fSAndroid Build Coastguard Worker check(npe, thisLine += 6, methodLine += 5, "$opt$noinline$getVolatileLongField"); 498*795d594fSAndroid Build Coastguard Worker } 499*795d594fSAndroid Build Coastguard Worker try { 500*795d594fSAndroid Build Coastguard Worker $opt$noinline$getVolatileDoubleField(null); 501*795d594fSAndroid Build Coastguard Worker throw new RuntimeException("Failed to throw NullPointerException."); 502*795d594fSAndroid Build Coastguard Worker } catch (NullPointerException npe) { 503*795d594fSAndroid Build Coastguard Worker check(npe, thisLine += 6, methodLine += 5, "$opt$noinline$getVolatileDoubleField"); 504*795d594fSAndroid Build Coastguard Worker } 505*795d594fSAndroid Build Coastguard Worker try { 506*795d594fSAndroid Build Coastguard Worker $opt$noinline$getVolatileByteField(null); 507*795d594fSAndroid Build Coastguard Worker throw new RuntimeException("Failed to throw NullPointerException."); 508*795d594fSAndroid Build Coastguard Worker } catch (NullPointerException npe) { 509*795d594fSAndroid Build Coastguard Worker check(npe, thisLine += 6, methodLine += 5, "$opt$noinline$getVolatileByteField"); 510*795d594fSAndroid Build Coastguard Worker } 511*795d594fSAndroid Build Coastguard Worker try { 512*795d594fSAndroid Build Coastguard Worker $opt$noinline$getVolatileBooleanField(null); 513*795d594fSAndroid Build Coastguard Worker throw new RuntimeException("Failed to throw NullPointerException."); 514*795d594fSAndroid Build Coastguard Worker } catch (NullPointerException npe) { 515*795d594fSAndroid Build Coastguard Worker check(npe, thisLine += 6, methodLine += 5, "$opt$noinline$getVolatileBooleanField"); 516*795d594fSAndroid Build Coastguard Worker } 517*795d594fSAndroid Build Coastguard Worker try { 518*795d594fSAndroid Build Coastguard Worker $opt$noinline$getVolatileCharField(null); 519*795d594fSAndroid Build Coastguard Worker throw new RuntimeException("Failed to throw NullPointerException."); 520*795d594fSAndroid Build Coastguard Worker } catch (NullPointerException npe) { 521*795d594fSAndroid Build Coastguard Worker check(npe, thisLine += 6, methodLine += 5, "$opt$noinline$getVolatileCharField"); 522*795d594fSAndroid Build Coastguard Worker } 523*795d594fSAndroid Build Coastguard Worker try { 524*795d594fSAndroid Build Coastguard Worker $opt$noinline$getVolatileShortField(null); 525*795d594fSAndroid Build Coastguard Worker throw new RuntimeException("Failed to throw NullPointerException."); 526*795d594fSAndroid Build Coastguard Worker } catch (NullPointerException npe) { 527*795d594fSAndroid Build Coastguard Worker check(npe, thisLine += 6, methodLine += 5, "$opt$noinline$getVolatileShortField"); 528*795d594fSAndroid Build Coastguard Worker } 529*795d594fSAndroid Build Coastguard Worker try { 530*795d594fSAndroid Build Coastguard Worker $opt$noinline$setObjectElement(null); 531*795d594fSAndroid Build Coastguard Worker throw new RuntimeException("Failed to throw NullPointerException."); 532*795d594fSAndroid Build Coastguard Worker } catch (NullPointerException npe) { 533*795d594fSAndroid Build Coastguard Worker check(npe, thisLine += 6, methodLine += 5, "$opt$noinline$setObjectElement"); 534*795d594fSAndroid Build Coastguard Worker } 535*795d594fSAndroid Build Coastguard Worker try { 536*795d594fSAndroid Build Coastguard Worker $opt$noinline$setIntElement(null); 537*795d594fSAndroid Build Coastguard Worker throw new RuntimeException("Failed to throw NullPointerException."); 538*795d594fSAndroid Build Coastguard Worker } catch (NullPointerException npe) { 539*795d594fSAndroid Build Coastguard Worker check(npe, thisLine += 6, methodLine += 5, "$opt$noinline$setIntElement"); 540*795d594fSAndroid Build Coastguard Worker } 541*795d594fSAndroid Build Coastguard Worker try { 542*795d594fSAndroid Build Coastguard Worker $opt$noinline$setFloatElement(null); 543*795d594fSAndroid Build Coastguard Worker throw new RuntimeException("Failed to throw NullPointerException."); 544*795d594fSAndroid Build Coastguard Worker } catch (NullPointerException npe) { 545*795d594fSAndroid Build Coastguard Worker check(npe, thisLine += 6, methodLine += 5, "$opt$noinline$setFloatElement"); 546*795d594fSAndroid Build Coastguard Worker } 547*795d594fSAndroid Build Coastguard Worker try { 548*795d594fSAndroid Build Coastguard Worker $opt$noinline$setLongElement(null); 549*795d594fSAndroid Build Coastguard Worker throw new RuntimeException("Failed to throw NullPointerException."); 550*795d594fSAndroid Build Coastguard Worker } catch (NullPointerException npe) { 551*795d594fSAndroid Build Coastguard Worker check(npe, thisLine += 6, methodLine += 5, "$opt$noinline$setLongElement"); 552*795d594fSAndroid Build Coastguard Worker } 553*795d594fSAndroid Build Coastguard Worker try { 554*795d594fSAndroid Build Coastguard Worker $opt$noinline$setDoubleElement(null); 555*795d594fSAndroid Build Coastguard Worker throw new RuntimeException("Failed to throw NullPointerException."); 556*795d594fSAndroid Build Coastguard Worker } catch (NullPointerException npe) { 557*795d594fSAndroid Build Coastguard Worker check(npe, thisLine += 6, methodLine += 5, "$opt$noinline$setDoubleElement"); 558*795d594fSAndroid Build Coastguard Worker } 559*795d594fSAndroid Build Coastguard Worker try { 560*795d594fSAndroid Build Coastguard Worker $opt$noinline$setByteElement(null); 561*795d594fSAndroid Build Coastguard Worker throw new RuntimeException("Failed to throw NullPointerException."); 562*795d594fSAndroid Build Coastguard Worker } catch (NullPointerException npe) { 563*795d594fSAndroid Build Coastguard Worker check(npe, thisLine += 6, methodLine += 5, "$opt$noinline$setByteElement"); 564*795d594fSAndroid Build Coastguard Worker } 565*795d594fSAndroid Build Coastguard Worker try { 566*795d594fSAndroid Build Coastguard Worker $opt$noinline$setBooleanElement(null); 567*795d594fSAndroid Build Coastguard Worker throw new RuntimeException("Failed to throw NullPointerException."); 568*795d594fSAndroid Build Coastguard Worker } catch (NullPointerException npe) { 569*795d594fSAndroid Build Coastguard Worker check(npe, thisLine += 6, methodLine += 5, "$opt$noinline$setBooleanElement"); 570*795d594fSAndroid Build Coastguard Worker } 571*795d594fSAndroid Build Coastguard Worker try { 572*795d594fSAndroid Build Coastguard Worker $opt$noinline$setCharElement(null); 573*795d594fSAndroid Build Coastguard Worker throw new RuntimeException("Failed to throw NullPointerException."); 574*795d594fSAndroid Build Coastguard Worker } catch (NullPointerException npe) { 575*795d594fSAndroid Build Coastguard Worker check(npe, thisLine += 6, methodLine += 5, "$opt$noinline$setCharElement"); 576*795d594fSAndroid Build Coastguard Worker } 577*795d594fSAndroid Build Coastguard Worker try { 578*795d594fSAndroid Build Coastguard Worker $opt$noinline$setShortElement(null); 579*795d594fSAndroid Build Coastguard Worker throw new RuntimeException("Failed to throw NullPointerException."); 580*795d594fSAndroid Build Coastguard Worker } catch (NullPointerException npe) { 581*795d594fSAndroid Build Coastguard Worker check(npe, thisLine += 6, methodLine += 5, "$opt$noinline$setShortElement"); 582*795d594fSAndroid Build Coastguard Worker } 583*795d594fSAndroid Build Coastguard Worker try { 584*795d594fSAndroid Build Coastguard Worker $opt$noinline$getObjectElement(null); 585*795d594fSAndroid Build Coastguard Worker throw new RuntimeException("Failed to throw NullPointerException."); 586*795d594fSAndroid Build Coastguard Worker } catch (NullPointerException npe) { 587*795d594fSAndroid Build Coastguard Worker check(npe, thisLine += 6, methodLine += 5, "$opt$noinline$getObjectElement"); 588*795d594fSAndroid Build Coastguard Worker } 589*795d594fSAndroid Build Coastguard Worker try { 590*795d594fSAndroid Build Coastguard Worker $opt$noinline$getIntElement(null); 591*795d594fSAndroid Build Coastguard Worker throw new RuntimeException("Failed to throw NullPointerException."); 592*795d594fSAndroid Build Coastguard Worker } catch (NullPointerException npe) { 593*795d594fSAndroid Build Coastguard Worker check(npe, thisLine += 6, methodLine += 5, "$opt$noinline$getIntElement"); 594*795d594fSAndroid Build Coastguard Worker } 595*795d594fSAndroid Build Coastguard Worker try { 596*795d594fSAndroid Build Coastguard Worker $opt$noinline$getFloatElement(null); 597*795d594fSAndroid Build Coastguard Worker throw new RuntimeException("Failed to throw NullPointerException."); 598*795d594fSAndroid Build Coastguard Worker } catch (NullPointerException npe) { 599*795d594fSAndroid Build Coastguard Worker check(npe, thisLine += 6, methodLine += 5, "$opt$noinline$getFloatElement"); 600*795d594fSAndroid Build Coastguard Worker } 601*795d594fSAndroid Build Coastguard Worker try { 602*795d594fSAndroid Build Coastguard Worker $opt$noinline$getLongElement(null); 603*795d594fSAndroid Build Coastguard Worker throw new RuntimeException("Failed to throw NullPointerException."); 604*795d594fSAndroid Build Coastguard Worker } catch (NullPointerException npe) { 605*795d594fSAndroid Build Coastguard Worker check(npe, thisLine += 6, methodLine += 5, "$opt$noinline$getLongElement"); 606*795d594fSAndroid Build Coastguard Worker } 607*795d594fSAndroid Build Coastguard Worker try { 608*795d594fSAndroid Build Coastguard Worker $opt$noinline$getDoubleElement(null); 609*795d594fSAndroid Build Coastguard Worker throw new RuntimeException("Failed to throw NullPointerException."); 610*795d594fSAndroid Build Coastguard Worker } catch (NullPointerException npe) { 611*795d594fSAndroid Build Coastguard Worker check(npe, thisLine += 6, methodLine += 5, "$opt$noinline$getDoubleElement"); 612*795d594fSAndroid Build Coastguard Worker } 613*795d594fSAndroid Build Coastguard Worker try { 614*795d594fSAndroid Build Coastguard Worker $opt$noinline$getByteElement(null); 615*795d594fSAndroid Build Coastguard Worker throw new RuntimeException("Failed to throw NullPointerException."); 616*795d594fSAndroid Build Coastguard Worker } catch (NullPointerException npe) { 617*795d594fSAndroid Build Coastguard Worker check(npe, thisLine += 6, methodLine += 5, "$opt$noinline$getByteElement"); 618*795d594fSAndroid Build Coastguard Worker } 619*795d594fSAndroid Build Coastguard Worker try { 620*795d594fSAndroid Build Coastguard Worker $opt$noinline$getBooleanElement(null); 621*795d594fSAndroid Build Coastguard Worker throw new RuntimeException("Failed to throw NullPointerException."); 622*795d594fSAndroid Build Coastguard Worker } catch (NullPointerException npe) { 623*795d594fSAndroid Build Coastguard Worker check(npe, thisLine += 6, methodLine += 5, "$opt$noinline$getBooleanElement"); 624*795d594fSAndroid Build Coastguard Worker } 625*795d594fSAndroid Build Coastguard Worker try { 626*795d594fSAndroid Build Coastguard Worker $opt$noinline$getCharElement(null); 627*795d594fSAndroid Build Coastguard Worker throw new RuntimeException("Failed to throw NullPointerException."); 628*795d594fSAndroid Build Coastguard Worker } catch (NullPointerException npe) { 629*795d594fSAndroid Build Coastguard Worker check(npe, thisLine += 6, methodLine += 5, "$opt$noinline$getCharElement"); 630*795d594fSAndroid Build Coastguard Worker } 631*795d594fSAndroid Build Coastguard Worker try { 632*795d594fSAndroid Build Coastguard Worker $opt$noinline$getShortElement(null); 633*795d594fSAndroid Build Coastguard Worker throw new RuntimeException("Failed to throw NullPointerException."); 634*795d594fSAndroid Build Coastguard Worker } catch (NullPointerException npe) { 635*795d594fSAndroid Build Coastguard Worker check(npe, thisLine += 6, methodLine += 5, "$opt$noinline$getShortElement"); 636*795d594fSAndroid Build Coastguard Worker } 637*795d594fSAndroid Build Coastguard Worker 638*795d594fSAndroid Build Coastguard Worker $opt$noinline$testRegisterRetrieval(); 639*795d594fSAndroid Build Coastguard Worker } 640*795d594fSAndroid Build Coastguard Worker $opt$noinline$testRegisterRetrieval()641*795d594fSAndroid Build Coastguard Worker static void $opt$noinline$testRegisterRetrieval() { 642*795d594fSAndroid Build Coastguard Worker Main[] array = $noinline$PrepareArray(); 643*795d594fSAndroid Build Coastguard Worker int i0 = 0; 644*795d594fSAndroid Build Coastguard Worker int i1 = 1; 645*795d594fSAndroid Build Coastguard Worker int i2 = 2; 646*795d594fSAndroid Build Coastguard Worker int i3 = 3; 647*795d594fSAndroid Build Coastguard Worker int i4 = 4; 648*795d594fSAndroid Build Coastguard Worker int i5 = 5; 649*795d594fSAndroid Build Coastguard Worker int i6 = 6; 650*795d594fSAndroid Build Coastguard Worker int i7 = 7; 651*795d594fSAndroid Build Coastguard Worker int i8 = 8; 652*795d594fSAndroid Build Coastguard Worker int i9 = 9; 653*795d594fSAndroid Build Coastguard Worker int i10 = 10; 654*795d594fSAndroid Build Coastguard Worker int i11 = 11; 655*795d594fSAndroid Build Coastguard Worker int i12 = 12; 656*795d594fSAndroid Build Coastguard Worker int i13 = 13; 657*795d594fSAndroid Build Coastguard Worker int i14 = 14; 658*795d594fSAndroid Build Coastguard Worker int i15 = 15; 659*795d594fSAndroid Build Coastguard Worker long l0 = 20L; 660*795d594fSAndroid Build Coastguard Worker long l1 = 21L; 661*795d594fSAndroid Build Coastguard Worker long l2 = 22L; 662*795d594fSAndroid Build Coastguard Worker long l3 = 23L; 663*795d594fSAndroid Build Coastguard Worker long l4 = 24L; 664*795d594fSAndroid Build Coastguard Worker long l5 = 25L; 665*795d594fSAndroid Build Coastguard Worker long l6 = 26L; 666*795d594fSAndroid Build Coastguard Worker long l7 = 27L; 667*795d594fSAndroid Build Coastguard Worker long l8 = 28L; 668*795d594fSAndroid Build Coastguard Worker long l9 = 29L; 669*795d594fSAndroid Build Coastguard Worker long l10 = 30L; 670*795d594fSAndroid Build Coastguard Worker long l11 = 31L; 671*795d594fSAndroid Build Coastguard Worker long l12 = 32L; 672*795d594fSAndroid Build Coastguard Worker long l13 = 33L; 673*795d594fSAndroid Build Coastguard Worker long l14 = 34L; 674*795d594fSAndroid Build Coastguard Worker long l15 = 35L; 675*795d594fSAndroid Build Coastguard Worker float f0 = 40.0f; 676*795d594fSAndroid Build Coastguard Worker float f1 = 41.0f; 677*795d594fSAndroid Build Coastguard Worker float f2 = 42.0f; 678*795d594fSAndroid Build Coastguard Worker float f3 = 43.0f; 679*795d594fSAndroid Build Coastguard Worker float f4 = 44.0f; 680*795d594fSAndroid Build Coastguard Worker float f5 = 45.0f; 681*795d594fSAndroid Build Coastguard Worker float f6 = 46.0f; 682*795d594fSAndroid Build Coastguard Worker float f7 = 47.0f; 683*795d594fSAndroid Build Coastguard Worker float f8 = 48.0f; 684*795d594fSAndroid Build Coastguard Worker float f9 = 49.0f; 685*795d594fSAndroid Build Coastguard Worker float f10 = 50.0f; 686*795d594fSAndroid Build Coastguard Worker float f11 = 51.0f; 687*795d594fSAndroid Build Coastguard Worker float f12 = 52.0f; 688*795d594fSAndroid Build Coastguard Worker float f13 = 53.0f; 689*795d594fSAndroid Build Coastguard Worker float f14 = 54.0f; 690*795d594fSAndroid Build Coastguard Worker float f15 = 55.0f; 691*795d594fSAndroid Build Coastguard Worker double d0 = 60.0; 692*795d594fSAndroid Build Coastguard Worker double d1 = 61.0; 693*795d594fSAndroid Build Coastguard Worker double d2 = 62.0; 694*795d594fSAndroid Build Coastguard Worker double d3 = 63.0; 695*795d594fSAndroid Build Coastguard Worker double d4 = 64.0; 696*795d594fSAndroid Build Coastguard Worker double d5 = 65.0; 697*795d594fSAndroid Build Coastguard Worker double d6 = 66.0; 698*795d594fSAndroid Build Coastguard Worker double d7 = 67.0; 699*795d594fSAndroid Build Coastguard Worker double d8 = 68.0; 700*795d594fSAndroid Build Coastguard Worker double d9 = 69.0; 701*795d594fSAndroid Build Coastguard Worker double d10 = 70.0; 702*795d594fSAndroid Build Coastguard Worker double d11 = 71.0; 703*795d594fSAndroid Build Coastguard Worker double d12 = 72.0; 704*795d594fSAndroid Build Coastguard Worker double d13 = 73.0; 705*795d594fSAndroid Build Coastguard Worker double d14 = 74.0; 706*795d594fSAndroid Build Coastguard Worker double d15 = 75.0; 707*795d594fSAndroid Build Coastguard Worker int addInt = -1; 708*795d594fSAndroid Build Coastguard Worker long addLong = -2L; 709*795d594fSAndroid Build Coastguard Worker float addFloat = -3.0f; 710*795d594fSAndroid Build Coastguard Worker double addDouble = -4.0; 711*795d594fSAndroid Build Coastguard Worker Main m = null; 712*795d594fSAndroid Build Coastguard Worker int i = 0; 713*795d594fSAndroid Build Coastguard Worker try { 714*795d594fSAndroid Build Coastguard Worker for (i = 0; i < array.length; ++i) { 715*795d594fSAndroid Build Coastguard Worker m = array[i]; 716*795d594fSAndroid Build Coastguard Worker // We have 16 ints, 16 longs, 16 floats, 16 doubles and a few helper variables here, 717*795d594fSAndroid Build Coastguard Worker // none of them anonymous. Hopefully, all available physical registers will be allocated 718*795d594fSAndroid Build Coastguard Worker // to these variables, so that when `m.intField` throws NPE during the third iteration, 719*795d594fSAndroid Build Coastguard Worker // we will fully test retrieval of values from all physical registers. 720*795d594fSAndroid Build Coastguard Worker addInt = m.intField; 721*795d594fSAndroid Build Coastguard Worker addLong = m.longField; 722*795d594fSAndroid Build Coastguard Worker addFloat = m.floatField; 723*795d594fSAndroid Build Coastguard Worker addDouble = m.doubleField; 724*795d594fSAndroid Build Coastguard Worker i0 += i1; 725*795d594fSAndroid Build Coastguard Worker i1 += i2; 726*795d594fSAndroid Build Coastguard Worker i2 += i3; 727*795d594fSAndroid Build Coastguard Worker i3 += i4; 728*795d594fSAndroid Build Coastguard Worker i4 += i5; 729*795d594fSAndroid Build Coastguard Worker i5 += i6; 730*795d594fSAndroid Build Coastguard Worker i6 += i7; 731*795d594fSAndroid Build Coastguard Worker i7 += i8; 732*795d594fSAndroid Build Coastguard Worker i8 += i9; 733*795d594fSAndroid Build Coastguard Worker i9 += i10; 734*795d594fSAndroid Build Coastguard Worker i10 += i11; 735*795d594fSAndroid Build Coastguard Worker i11 += i12; 736*795d594fSAndroid Build Coastguard Worker i12 += i13; 737*795d594fSAndroid Build Coastguard Worker i13 += i14; 738*795d594fSAndroid Build Coastguard Worker i14 += i15; 739*795d594fSAndroid Build Coastguard Worker i15 += addInt; 740*795d594fSAndroid Build Coastguard Worker l0 += l1; 741*795d594fSAndroid Build Coastguard Worker l1 += l2; 742*795d594fSAndroid Build Coastguard Worker l2 += l3; 743*795d594fSAndroid Build Coastguard Worker l3 += l4; 744*795d594fSAndroid Build Coastguard Worker l4 += l5; 745*795d594fSAndroid Build Coastguard Worker l5 += l6; 746*795d594fSAndroid Build Coastguard Worker l6 += l7; 747*795d594fSAndroid Build Coastguard Worker l7 += l8; 748*795d594fSAndroid Build Coastguard Worker l8 += l9; 749*795d594fSAndroid Build Coastguard Worker l9 += l10; 750*795d594fSAndroid Build Coastguard Worker l10 += l11; 751*795d594fSAndroid Build Coastguard Worker l11 += l12; 752*795d594fSAndroid Build Coastguard Worker l12 += l13; 753*795d594fSAndroid Build Coastguard Worker l13 += l14; 754*795d594fSAndroid Build Coastguard Worker l14 += l15; 755*795d594fSAndroid Build Coastguard Worker l15 += addLong; 756*795d594fSAndroid Build Coastguard Worker f0 += f1; 757*795d594fSAndroid Build Coastguard Worker f1 += f2; 758*795d594fSAndroid Build Coastguard Worker f2 += f3; 759*795d594fSAndroid Build Coastguard Worker f3 += f4; 760*795d594fSAndroid Build Coastguard Worker f4 += f5; 761*795d594fSAndroid Build Coastguard Worker f5 += f6; 762*795d594fSAndroid Build Coastguard Worker f6 += f7; 763*795d594fSAndroid Build Coastguard Worker f7 += f8; 764*795d594fSAndroid Build Coastguard Worker f8 += f9; 765*795d594fSAndroid Build Coastguard Worker f9 += f10; 766*795d594fSAndroid Build Coastguard Worker f10 += f11; 767*795d594fSAndroid Build Coastguard Worker f11 += f12; 768*795d594fSAndroid Build Coastguard Worker f12 += f13; 769*795d594fSAndroid Build Coastguard Worker f13 += f14; 770*795d594fSAndroid Build Coastguard Worker f14 += f15; 771*795d594fSAndroid Build Coastguard Worker f15 += addFloat; 772*795d594fSAndroid Build Coastguard Worker d0 += d1; 773*795d594fSAndroid Build Coastguard Worker d1 += d2; 774*795d594fSAndroid Build Coastguard Worker d2 += d3; 775*795d594fSAndroid Build Coastguard Worker d3 += d4; 776*795d594fSAndroid Build Coastguard Worker d4 += d5; 777*795d594fSAndroid Build Coastguard Worker d5 += d6; 778*795d594fSAndroid Build Coastguard Worker d6 += d7; 779*795d594fSAndroid Build Coastguard Worker d7 += d8; 780*795d594fSAndroid Build Coastguard Worker d8 += d9; 781*795d594fSAndroid Build Coastguard Worker d9 += d10; 782*795d594fSAndroid Build Coastguard Worker d10 += d11; 783*795d594fSAndroid Build Coastguard Worker d11 += d12; 784*795d594fSAndroid Build Coastguard Worker d12 += d13; 785*795d594fSAndroid Build Coastguard Worker d13 += d14; 786*795d594fSAndroid Build Coastguard Worker d14 += d15; 787*795d594fSAndroid Build Coastguard Worker d15 += addDouble; 788*795d594fSAndroid Build Coastguard Worker } 789*795d594fSAndroid Build Coastguard Worker } catch (NullPointerException npe) { 790*795d594fSAndroid Build Coastguard Worker System.out.println("i0=" + i0); 791*795d594fSAndroid Build Coastguard Worker System.out.println("i1=" + i1); 792*795d594fSAndroid Build Coastguard Worker System.out.println("i2=" + i2); 793*795d594fSAndroid Build Coastguard Worker System.out.println("i3=" + i3); 794*795d594fSAndroid Build Coastguard Worker System.out.println("i4=" + i4); 795*795d594fSAndroid Build Coastguard Worker System.out.println("i5=" + i5); 796*795d594fSAndroid Build Coastguard Worker System.out.println("i6=" + i6); 797*795d594fSAndroid Build Coastguard Worker System.out.println("i7=" + i7); 798*795d594fSAndroid Build Coastguard Worker System.out.println("i8=" + i8); 799*795d594fSAndroid Build Coastguard Worker System.out.println("i9=" + i9); 800*795d594fSAndroid Build Coastguard Worker System.out.println("i10=" + i10); 801*795d594fSAndroid Build Coastguard Worker System.out.println("i11=" + i11); 802*795d594fSAndroid Build Coastguard Worker System.out.println("i12=" + i12); 803*795d594fSAndroid Build Coastguard Worker System.out.println("i13=" + i13); 804*795d594fSAndroid Build Coastguard Worker System.out.println("i14=" + i14); 805*795d594fSAndroid Build Coastguard Worker System.out.println("i15=" + i15); 806*795d594fSAndroid Build Coastguard Worker System.out.println("l0=" + l0); 807*795d594fSAndroid Build Coastguard Worker System.out.println("l1=" + l1); 808*795d594fSAndroid Build Coastguard Worker System.out.println("l2=" + l2); 809*795d594fSAndroid Build Coastguard Worker System.out.println("l3=" + l3); 810*795d594fSAndroid Build Coastguard Worker System.out.println("l4=" + l4); 811*795d594fSAndroid Build Coastguard Worker System.out.println("l5=" + l5); 812*795d594fSAndroid Build Coastguard Worker System.out.println("l6=" + l6); 813*795d594fSAndroid Build Coastguard Worker System.out.println("l7=" + l7); 814*795d594fSAndroid Build Coastguard Worker System.out.println("l8=" + l8); 815*795d594fSAndroid Build Coastguard Worker System.out.println("l9=" + l9); 816*795d594fSAndroid Build Coastguard Worker System.out.println("l10=" + l10); 817*795d594fSAndroid Build Coastguard Worker System.out.println("l11=" + l11); 818*795d594fSAndroid Build Coastguard Worker System.out.println("l12=" + l12); 819*795d594fSAndroid Build Coastguard Worker System.out.println("l13=" + l13); 820*795d594fSAndroid Build Coastguard Worker System.out.println("l14=" + l14); 821*795d594fSAndroid Build Coastguard Worker System.out.println("l15=" + l15); 822*795d594fSAndroid Build Coastguard Worker System.out.println("f0=" + f0); 823*795d594fSAndroid Build Coastguard Worker System.out.println("f1=" + f1); 824*795d594fSAndroid Build Coastguard Worker System.out.println("f2=" + f2); 825*795d594fSAndroid Build Coastguard Worker System.out.println("f3=" + f3); 826*795d594fSAndroid Build Coastguard Worker System.out.println("f4=" + f4); 827*795d594fSAndroid Build Coastguard Worker System.out.println("f5=" + f5); 828*795d594fSAndroid Build Coastguard Worker System.out.println("f6=" + f6); 829*795d594fSAndroid Build Coastguard Worker System.out.println("f7=" + f7); 830*795d594fSAndroid Build Coastguard Worker System.out.println("f8=" + f8); 831*795d594fSAndroid Build Coastguard Worker System.out.println("f9=" + f9); 832*795d594fSAndroid Build Coastguard Worker System.out.println("f10=" + f10); 833*795d594fSAndroid Build Coastguard Worker System.out.println("f11=" + f11); 834*795d594fSAndroid Build Coastguard Worker System.out.println("f12=" + f12); 835*795d594fSAndroid Build Coastguard Worker System.out.println("f13=" + f13); 836*795d594fSAndroid Build Coastguard Worker System.out.println("f14=" + f14); 837*795d594fSAndroid Build Coastguard Worker System.out.println("f15=" + f15); 838*795d594fSAndroid Build Coastguard Worker System.out.println("d0=" + d0); 839*795d594fSAndroid Build Coastguard Worker System.out.println("d1=" + d1); 840*795d594fSAndroid Build Coastguard Worker System.out.println("d2=" + d2); 841*795d594fSAndroid Build Coastguard Worker System.out.println("d3=" + d3); 842*795d594fSAndroid Build Coastguard Worker System.out.println("d4=" + d4); 843*795d594fSAndroid Build Coastguard Worker System.out.println("d5=" + d5); 844*795d594fSAndroid Build Coastguard Worker System.out.println("d6=" + d6); 845*795d594fSAndroid Build Coastguard Worker System.out.println("d7=" + d7); 846*795d594fSAndroid Build Coastguard Worker System.out.println("d8=" + d8); 847*795d594fSAndroid Build Coastguard Worker System.out.println("d9=" + d9); 848*795d594fSAndroid Build Coastguard Worker System.out.println("d10=" + d10); 849*795d594fSAndroid Build Coastguard Worker System.out.println("d11=" + d11); 850*795d594fSAndroid Build Coastguard Worker System.out.println("d12=" + d12); 851*795d594fSAndroid Build Coastguard Worker System.out.println("d13=" + d13); 852*795d594fSAndroid Build Coastguard Worker System.out.println("d14=" + d14); 853*795d594fSAndroid Build Coastguard Worker System.out.println("d15=" + d15); 854*795d594fSAndroid Build Coastguard Worker System.out.println("addInt=" + addInt); 855*795d594fSAndroid Build Coastguard Worker System.out.println("addLong=" + addLong); 856*795d594fSAndroid Build Coastguard Worker System.out.println("addFloat=" + addFloat); 857*795d594fSAndroid Build Coastguard Worker System.out.println("addDouble=" + addDouble); 858*795d594fSAndroid Build Coastguard Worker System.out.println("m=" + m); 859*795d594fSAndroid Build Coastguard Worker System.out.println("i=" + i); 860*795d594fSAndroid Build Coastguard Worker } 861*795d594fSAndroid Build Coastguard Worker } 862*795d594fSAndroid Build Coastguard Worker $noinline$PrepareArray()863*795d594fSAndroid Build Coastguard Worker static Main[] $noinline$PrepareArray() { 864*795d594fSAndroid Build Coastguard Worker if (doThrow) { throw new Error(); } 865*795d594fSAndroid Build Coastguard Worker Main[] array = new Main[] { new Main(), new Main(), null, new Main() }; 866*795d594fSAndroid Build Coastguard Worker array[1].intField = 42; 867*795d594fSAndroid Build Coastguard Worker array[1].longField = 111L; 868*795d594fSAndroid Build Coastguard Worker array[1].floatField = 0.5f; 869*795d594fSAndroid Build Coastguard Worker array[1].doubleField = 0.125; 870*795d594fSAndroid Build Coastguard Worker return array; 871*795d594fSAndroid Build Coastguard Worker } 872*795d594fSAndroid Build Coastguard Worker check(NullPointerException npe, int mainLine, int methodLine, String methodName)873*795d594fSAndroid Build Coastguard Worker static void check(NullPointerException npe, int mainLine, int methodLine, String methodName) { 874*795d594fSAndroid Build Coastguard Worker System.out.println(methodName); 875*795d594fSAndroid Build Coastguard Worker StackTraceElement[] trace = npe.getStackTrace(); 876*795d594fSAndroid Build Coastguard Worker checkElement(trace[0], "Main", methodName, "Main.java", methodLine); 877*795d594fSAndroid Build Coastguard Worker checkElement(trace[1], "Main", "main", "Main.java", mainLine); 878*795d594fSAndroid Build Coastguard Worker } 879*795d594fSAndroid Build Coastguard Worker checkElement(StackTraceElement element, String declaringClass, String methodName, String fileName, int lineNumber)880*795d594fSAndroid Build Coastguard Worker static void checkElement(StackTraceElement element, 881*795d594fSAndroid Build Coastguard Worker String declaringClass, String methodName, 882*795d594fSAndroid Build Coastguard Worker String fileName, int lineNumber) { 883*795d594fSAndroid Build Coastguard Worker assertEquals(declaringClass, element.getClassName()); 884*795d594fSAndroid Build Coastguard Worker assertEquals(methodName, element.getMethodName()); 885*795d594fSAndroid Build Coastguard Worker assertEquals(fileName, element.getFileName()); 886*795d594fSAndroid Build Coastguard Worker assertEquals(lineNumber, element.getLineNumber()); 887*795d594fSAndroid Build Coastguard Worker } 888*795d594fSAndroid Build Coastguard Worker assertEquals(Object expected, Object actual)889*795d594fSAndroid Build Coastguard Worker static void assertEquals(Object expected, Object actual) { 890*795d594fSAndroid Build Coastguard Worker if (!expected.equals(actual)) { 891*795d594fSAndroid Build Coastguard Worker String msg = "Expected \"" + expected + "\" but got \"" + actual + "\""; 892*795d594fSAndroid Build Coastguard Worker throw new AssertionError(msg); 893*795d594fSAndroid Build Coastguard Worker } 894*795d594fSAndroid Build Coastguard Worker } 895*795d594fSAndroid Build Coastguard Worker assertEquals(int expected, int actual)896*795d594fSAndroid Build Coastguard Worker static void assertEquals(int expected, int actual) { 897*795d594fSAndroid Build Coastguard Worker if (expected != actual) { 898*795d594fSAndroid Build Coastguard Worker throw new AssertionError("Expected " + expected + " got " + actual); 899*795d594fSAndroid Build Coastguard Worker } 900*795d594fSAndroid Build Coastguard Worker } 901*795d594fSAndroid Build Coastguard Worker 902*795d594fSAndroid Build Coastguard Worker } 903