Patch: FYI: Test for PR 8823

Tom Tromey tromey@redhat.com
Sun Dec 8 17:19:00 GMT 2002


I'm checking this in.

This tests for the bug in PR 8823.

I think this is a bug both in gcj and libgcj.  libgcj should handle
this situation, but gcj should also generate a declaration for the
interface method in the abstract class.

Tom

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

	Test for PR libgcj/8823:
	* libjava.lang/pr8823.java: New file.
	* libjava.lang/pr8823.out: New file.

Index: libjava.lang/pr8823.java
===================================================================
RCS file: libjava.lang/pr8823.java
diff -N libjava.lang/pr8823.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ libjava.lang/pr8823.java 9 Dec 2002 01:17:01 -0000
@@ -0,0 +1,24 @@
+interface I
+{
+  public void m();
+}
+
+abstract class A implements I
+{
+  // But doesn't define m()
+}
+
+public class pr8823 extends A // which means it implements I
+{
+  public static void main(String[] args)
+  {
+    // Defining c as either I or C will work.
+    A c = new pr8823();
+    c.m();
+  }
+
+  public void m()
+  {
+    System.out.println("Hello World!");
+  }
+}
Index: libjava.lang/pr8823.out
===================================================================
RCS file: libjava.lang/pr8823.out
diff -N libjava.lang/pr8823.out
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ libjava.lang/pr8823.out 9 Dec 2002 01:17:01 -0000
@@ -0,0 +1 @@
+Hello World!



More information about the Java-patches mailing list