upload android base code part3

This commit is contained in:
August 2018-08-08 16:48:17 +08:00
parent 71b83c22f1
commit b9e30e05b1
15122 changed files with 2089659 additions and 0 deletions

View file

@ -0,0 +1,70 @@
/*
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
public class Base {
Base() {
intField = 0; // Unnecessary IPUT.
doubleField = 0.0; // Unnecessary IPUT.
objectField = null; // Unnecessary IPUT.
}
Base(int intValue) {
intField = intValue;
}
Base(String stringValue) {
objectField = stringValue; // Unnecessary IPUT.
stringField = stringValue;
objectField = null; // Unnecessary IPUT.
}
Base(double doubleValue, Object objectValue) {
doubleField = doubleValue;
objectField = objectValue;
}
Base(int intValue, double doubleValue, Object objectValue) {
intField = intValue;
doubleField = doubleValue;
objectField = objectValue;
}
Base(int intValue, double doubleValue, Object objectValue, String stringValue) {
// Outside our limit of 3 IPUTs.
intField = intValue;
doubleField = doubleValue;
objectField = objectValue;
stringField = stringValue;
}
Base(double doubleValue) {
this(doubleValue, null);
}
Base(Object objectValue) {
// Unsupported forwarding of a value after a zero.
this(0.0, objectValue);
}
Base(int intValue, long dummy) {
this(intValue, 0.0, null);
}
public int intField;
public double doubleField;
public Object objectField;
public String stringField;
}

View file

@ -0,0 +1,27 @@
/*
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
public class BaseWithFinalField {
BaseWithFinalField() {
intField = 0;
}
BaseWithFinalField(int intValue) {
intField = intValue;
}
public final int intField;
}

View file

@ -0,0 +1,63 @@
/*
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
public final class Derived extends Base {
public Derived() {
this(0);
}
public Derived(int intValue) {
super(intValue);
}
public Derived(String stringValue) {
super(stringValue);
stringField = null; // Clear field set by Base.<init>(String).
}
public Derived(double doubleValue) {
super(doubleValue, null);
}
public Derived(int intValue, double doubleValue, Object objectValue) {
super(intValue, doubleValue, objectValue);
objectField = null; // Clear field set by Base.<init>(int, double, Object).
intField = 0; // Clear field set by Base.<init>(int, double, Object).
}
Derived(int intValue, double doubleValue, Object objectValue, String stringValue) {
super(intValue, doubleValue, objectValue, stringValue);
// Clearing fields here doesn't help because the superclass constructor must
// satisfy the pattern constraints on its own and it doesn't (it has 4 IPUTs).
intField = 0;
doubleField = 0.0;
objectField = null;
stringField = null;
}
public Derived(float floatValue) {
super();
floatField = floatValue;
}
public Derived(int intValue, double doubleValue, Object objectValue, float floatValue) {
super(intValue, doubleValue, objectValue);
objectField = null; // Clear field set by Base.<init>(int, double, Object).
floatField = floatValue;
}
public float floatField;
}

View file

@ -0,0 +1,31 @@
/*
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
public final class DerivedInSecondDex extends BaseInMainDex {
DerivedInSecondDex() {
super();
}
DerivedInSecondDex(int intValue) {
// Not matched: Superclass in a different dex file has an IPUT.
super(intValue);
}
DerivedInSecondDex(long dummy) {
// Matched: Superclass in a different dex file has an IPUT that's pruned because we store 0.
super(0);
}
}

View file

@ -0,0 +1,38 @@
/*
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
public final class DerivedWithFinalField extends BaseWithFinalField {
DerivedWithFinalField() {
this(0);
}
DerivedWithFinalField(int intValue) {
super(intValue);
doubleField = 0.0;
}
DerivedWithFinalField(double doubleValue) {
super(0);
doubleField = doubleValue;
}
DerivedWithFinalField(int intValue, double doubleValue) {
super(intValue);
doubleField = doubleValue;
}
public final double doubleField;
}

View file

@ -0,0 +1,103 @@
/*
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
public final class Second {
public static void staticNop(int unused) { }
public void nop() { }
public static Object staticReturnArg2(int unused1, String arg2) {
return arg2;
}
public long returnArg1(long arg1) {
return arg1;
}
public static int staticReturn9() {
return 9;
}
public int return7(Object unused) {
return 7;
}
public static String staticReturnNull() {
return null;
}
public Object returnNull() {
return null;
}
public int getInstanceIntField() {
return instanceIntField;
}
public double getInstanceDoubleField(int unused1) {
return instanceDoubleField;
}
public Object getInstanceObjectField(long unused1) {
return instanceObjectField;
}
public String getInstanceStringField(Object unused1, String unused2, long unused3) {
return instanceStringField;
}
public static int staticGetInstanceIntField(Second s) {
return s.instanceIntField;
}
public double getInstanceDoubleFieldFromParam(Second s) {
return s.instanceDoubleField;
}
public int getStaticIntField() {
return staticIntField;
}
public void setInstanceLongField(int ignored, long value) {
instanceLongField = value;
}
public int setInstanceLongFieldReturnArg2(long value, int arg2) {
instanceLongField = value;
return arg2;
}
public static void staticSetInstanceLongField(Second s, long value) {
s.instanceLongField = value;
}
public void setInstanceLongFieldThroughParam(Second s, long value) {
s.instanceLongField = value;
}
public void setStaticFloatField(float value) {
staticFloatField = value;
}
public int instanceIntField = 42;
public double instanceDoubleField = -42.0;
public Object instanceObjectField = null;
public String instanceStringField = "dummy";
public long instanceLongField = 0; // Overwritten by setters.
public static int staticIntField = 4242;
public static float staticFloatField = 0.0f; // Overwritten by setters.
}