upload android base code part3
This commit is contained in:
parent
71b83c22f1
commit
b9e30e05b1
15122 changed files with 2089659 additions and 0 deletions
1
android/art/test/161-final-abstract-class/expected.txt
Normal file
1
android/art/test/161-final-abstract-class/expected.txt
Normal file
|
@ -0,0 +1 @@
|
|||
java.lang.InstantiationError: AbstractFinal
|
1
android/art/test/161-final-abstract-class/info.txt
Normal file
1
android/art/test/161-final-abstract-class/info.txt
Normal file
|
@ -0,0 +1 @@
|
|||
Regression test for verifier crash when processing a final abstract (erroneous) class.
|
|
@ -0,0 +1,16 @@
|
|||
# Copyright (C) 2017 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.
|
||||
|
||||
.class abstract final LAbstractFinal;
|
||||
.super Ljava/lang/Object;
|
|
@ -0,0 +1,22 @@
|
|||
# Copyright (C) 2017 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.
|
||||
|
||||
.class LTestClass;
|
||||
.super Ljava/lang/Object;
|
||||
|
||||
.method public static test()V
|
||||
.registers 1
|
||||
new-instance v0, LAbstractFinal;
|
||||
return-void
|
||||
.end method
|
48
android/art/test/161-final-abstract-class/src/Main.java
Normal file
48
android/art/test/161-final-abstract-class/src/Main.java
Normal file
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
* Copyright (C) 2017 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.
|
||||
*/
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
public class Main {
|
||||
public static void main(String[] args) {
|
||||
try {
|
||||
// Make sure that the abstract final class is marked as erroneous.
|
||||
Class.forName("AbstractFinal");
|
||||
System.out.println("UNREACHABLE!");
|
||||
} catch (VerifyError expected) {
|
||||
} catch (Throwable t) {
|
||||
t.printStackTrace(System.out);
|
||||
}
|
||||
try {
|
||||
// Verification of TestClass.test() used to crash when processing
|
||||
// the final abstract (erroneous) class.
|
||||
Class<?> tc = Class.forName("TestClass");
|
||||
Method test = tc.getDeclaredMethod("test");
|
||||
test.invoke(null);
|
||||
System.out.println("UNREACHABLE!");
|
||||
} catch (InvocationTargetException ite) {
|
||||
if (ite.getCause() instanceof InstantiationError) {
|
||||
System.out.println(
|
||||
ite.getCause().getClass().getName() + ": " + ite.getCause().getMessage());
|
||||
} else {
|
||||
ite.printStackTrace(System.out);
|
||||
}
|
||||
} catch (Throwable t) {
|
||||
t.printStackTrace(System.out);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue