summaryrefslogtreecommitdiffstats
path: root/test/066-mismatched-super
diff options
context:
space:
mode:
Diffstat (limited to 'test/066-mismatched-super')
-rw-r--r--test/066-mismatched-super/expected.txt1
-rw-r--r--test/066-mismatched-super/info.txt2
-rw-r--r--test/066-mismatched-super/src/Base.java5
-rw-r--r--test/066-mismatched-super/src/Defs.java11
-rw-r--r--test/066-mismatched-super/src/Indirect.java27
-rw-r--r--test/066-mismatched-super/src/Main.java29
-rw-r--r--test/066-mismatched-super/src2/Defs.java7
7 files changed, 82 insertions, 0 deletions
diff --git a/test/066-mismatched-super/expected.txt b/test/066-mismatched-super/expected.txt
new file mode 100644
index 0000000000..09c05967d9
--- /dev/null
+++ b/test/066-mismatched-super/expected.txt
@@ -0,0 +1 @@
+Got expected ICCE
diff --git a/test/066-mismatched-super/info.txt b/test/066-mismatched-super/info.txt
new file mode 100644
index 0000000000..7865ffc4a8
--- /dev/null
+++ b/test/066-mismatched-super/info.txt
@@ -0,0 +1,2 @@
+This tests what happens when class A extends abstract class B, but somebody
+turns B into an interface without rebuilding A.
diff --git a/test/066-mismatched-super/src/Base.java b/test/066-mismatched-super/src/Base.java
new file mode 100644
index 0000000000..6180c8bbfa
--- /dev/null
+++ b/test/066-mismatched-super/src/Base.java
@@ -0,0 +1,5 @@
+// Copyright 2008 The Android Open Source Project
+
+public class Base extends Defs {
+ // no need to implement func(), provided by abstract class
+};
diff --git a/test/066-mismatched-super/src/Defs.java b/test/066-mismatched-super/src/Defs.java
new file mode 100644
index 0000000000..e7eb8a14a7
--- /dev/null
+++ b/test/066-mismatched-super/src/Defs.java
@@ -0,0 +1,11 @@
+// Copyright 2008 The Android Open Source Project
+
+public abstract class Defs {
+ public void func() {
+ System.out.println("yo");
+ }
+
+ public void func2() {
+ System.out.println("yo yo");
+ }
+}
diff --git a/test/066-mismatched-super/src/Indirect.java b/test/066-mismatched-super/src/Indirect.java
new file mode 100644
index 0000000000..023e409f79
--- /dev/null
+++ b/test/066-mismatched-super/src/Indirect.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright (C) 2008 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.
+ */
+
+/**
+ * Error indirection class.
+ *
+ * Some VMs will load this class and fail on the "new" call, others will
+ * refuse to load this class at all.
+ */
+public class Indirect {
+ public static void main() {
+ Base base = new Base();
+ }
+}
diff --git a/test/066-mismatched-super/src/Main.java b/test/066-mismatched-super/src/Main.java
new file mode 100644
index 0000000000..5975b99e92
--- /dev/null
+++ b/test/066-mismatched-super/src/Main.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2008 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.
+ */
+
+/*
+ * Test field access through reflection.
+ */
+public class Main {
+ public static void main(String[] args) {
+ try {
+ Indirect.main();
+ System.err.println("Succeeded unexpectedly");
+ } catch (IncompatibleClassChangeError icce) {
+ System.out.println("Got expected ICCE");
+ }
+ }
+}
diff --git a/test/066-mismatched-super/src2/Defs.java b/test/066-mismatched-super/src2/Defs.java
new file mode 100644
index 0000000000..bab92d8424
--- /dev/null
+++ b/test/066-mismatched-super/src2/Defs.java
@@ -0,0 +1,7 @@
+// Copyright 2008 The Android Open Source Project
+
+public interface Defs {
+ public void func();
+
+ // func2 not defined
+}