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