1 /* 2 * Copyright (C) 2016 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 final class Second { staticNop(int unused)18 public static void staticNop(int unused) { } 19 nop()20 public void nop() { } 21 staticReturnArg2(int unused1, String arg2)22 public static Object staticReturnArg2(int unused1, String arg2) { 23 return arg2; 24 } 25 returnArg1(long arg1)26 public long returnArg1(long arg1) { 27 return arg1; 28 } 29 staticReturn9()30 public static int staticReturn9() { 31 return 9; 32 } 33 return7(Object unused)34 public int return7(Object unused) { 35 return 7; 36 } 37 staticReturnNull()38 public static String staticReturnNull() { 39 return null; 40 } 41 returnNull()42 public Object returnNull() { 43 return null; 44 } 45 getInstanceIntField()46 public int getInstanceIntField() { 47 return instanceIntField; 48 } 49 getInstanceDoubleField(int unused1)50 public double getInstanceDoubleField(int unused1) { 51 return instanceDoubleField; 52 } 53 getInstanceObjectField(long unused1)54 public Object getInstanceObjectField(long unused1) { 55 return instanceObjectField; 56 } 57 getInstanceStringField(Object unused1, String unused2, long unused3)58 public String getInstanceStringField(Object unused1, String unused2, long unused3) { 59 return instanceStringField; 60 } 61 staticGetInstanceIntField(Second s)62 public static int staticGetInstanceIntField(Second s) { 63 return s.instanceIntField; 64 } 65 getInstanceDoubleFieldFromParam(Second s)66 public double getInstanceDoubleFieldFromParam(Second s) { 67 return s.instanceDoubleField; 68 } 69 getStaticIntField()70 public int getStaticIntField() { 71 return staticIntField; 72 } 73 setInstanceLongField(int ignored, long value)74 public void setInstanceLongField(int ignored, long value) { 75 instanceLongField = value; 76 } 77 setInstanceLongFieldReturnArg2(long value, int arg2)78 public int setInstanceLongFieldReturnArg2(long value, int arg2) { 79 instanceLongField = value; 80 return arg2; 81 } 82 staticSetInstanceLongField(Second s, long value)83 public static void staticSetInstanceLongField(Second s, long value) { 84 s.instanceLongField = value; 85 } 86 setInstanceLongFieldThroughParam(Second s, long value)87 public void setInstanceLongFieldThroughParam(Second s, long value) { 88 s.instanceLongField = value; 89 } 90 setStaticFloatField(float value)91 public void setStaticFloatField(float value) { 92 staticFloatField = value; 93 } 94 95 public int instanceIntField = 42; 96 public double instanceDoubleField = -42.0; 97 public Object instanceObjectField = null; 98 public String instanceStringField = "dummy"; 99 public long instanceLongField = 0; // Overwritten by setters. 100 101 public static int staticIntField = 4242; 102 public static float staticFloatField = 0.0f; // Overwritten by setters. 103 } 104