Vladimir Marko | be10e8e | 2016-01-22 12:09:44 +0000 | [diff] [blame] | 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 { |
| 18 | public static void staticNop(int unused) { } |
| 19 | |
| 20 | public void nop() { } |
| 21 | |
| 22 | public static Object staticReturnArg2(int unused1, String arg2) { |
| 23 | return arg2; |
| 24 | } |
| 25 | |
| 26 | public long returnArg1(long arg1) { |
| 27 | return arg1; |
| 28 | } |
| 29 | |
| 30 | public static int staticReturn9() { |
| 31 | return 9; |
| 32 | } |
| 33 | |
| 34 | public int return7(Object unused) { |
| 35 | return 7; |
| 36 | } |
| 37 | |
| 38 | public static String staticReturnNull() { |
| 39 | return null; |
| 40 | } |
| 41 | |
| 42 | public Object returnNull() { |
| 43 | return null; |
| 44 | } |
| 45 | |
| 46 | public int getInstanceIntField() { |
| 47 | return instanceIntField; |
| 48 | } |
| 49 | |
| 50 | public double getInstanceDoubleField(int unused1) { |
| 51 | return instanceDoubleField; |
| 52 | } |
| 53 | |
| 54 | public Object getInstanceObjectField(long unused1) { |
| 55 | return instanceObjectField; |
| 56 | } |
| 57 | |
| 58 | public String getInstanceStringField(Object unused1, String unused2, long unused3) { |
| 59 | return instanceStringField; |
| 60 | } |
| 61 | |
| 62 | public static int staticGetInstanceIntField(Second s) { |
| 63 | return s.instanceIntField; |
| 64 | } |
| 65 | |
| 66 | public double getInstanceDoubleFieldFromParam(Second s) { |
| 67 | return s.instanceDoubleField; |
| 68 | } |
| 69 | |
| 70 | public int getStaticIntField() { |
| 71 | return staticIntField; |
| 72 | } |
| 73 | |
| 74 | public void setInstanceLongField(int ignored, long value) { |
| 75 | instanceLongField = value; |
| 76 | } |
| 77 | |
| 78 | public int setInstanceLongFieldReturnArg2(long value, int arg2) { |
| 79 | instanceLongField = value; |
| 80 | return arg2; |
| 81 | } |
| 82 | |
| 83 | public static void staticSetInstanceLongField(Second s, long value) { |
| 84 | s.instanceLongField = value; |
| 85 | } |
| 86 | |
| 87 | public void setInstanceLongFieldThroughParam(Second s, long value) { |
| 88 | s.instanceLongField = value; |
| 89 | } |
| 90 | |
| 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 | } |