This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch: FYI: test case


A test case for a potential bug I ran across while working on the
recent vtable patch.

Tom

Index: ChangeLog
from  Tom Tromey  <tromey@redhat.com>

	* libjava.lang/override.java: New file.
	* libjava.lang/override.out: new file.

Index: libjava.lang/override.java
===================================================================
RCS file: libjava.lang/override.java
diff -N libjava.lang/override.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ libjava.lang/override.java 5 Dec 2002 07:51:42 -0000
@@ -0,0 +1,19 @@
+// Regression test that overrides a virtual method with a final one.
+
+class override1
+{
+  public int x1 () { return 3; }
+}
+
+public class override extends override1
+{
+  public final int x1() { return 5; }
+  public final int x2() { return 7; }
+
+  public static void main(String[] args)
+  {
+    override z = new override();
+    System.out.println(z.x1());
+    System.out.println(z.x2());
+  }
+}
Index: libjava.lang/override.out
===================================================================
RCS file: libjava.lang/override.out
diff -N libjava.lang/override.out
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ libjava.lang/override.out 5 Dec 2002 07:51:42 -0000
@@ -0,0 +1,2 @@
+5
+7


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]