Patch: FYI: new test case

Tom Tromey tromey@redhat.com
Sat Nov 2 15:36:00 GMT 2002


I'm checking this in.

This is a test case for an error condition in class initialization.
Currently we fail this test.  I have a fix which I'll check in
shortly.

Note that even with my patch we still fail when optimizing.  I believe
we inline in a situation where we shouldn't.

Tom

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

	* libjava.lang/initexc.java: New file.
	* libjava.lang/initexc.out: New file.

Index: libjava.lang/initexc.java
===================================================================
RCS file: libjava.lang/initexc.java
diff -N libjava.lang/initexc.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ libjava.lang/initexc.java 2 Nov 2002 23:34:33 -0000
@@ -0,0 +1,35 @@
+public class initexc
+{
+  public static class fail
+  {
+    static
+    {
+      throw new NullPointerException("nope");
+    }
+
+    public static int val ()
+    {
+      return 23;
+    }
+  }
+
+  public static void main (String[] args)
+  {
+    try
+      {
+	System.out.println (fail.val ());
+      }
+    catch (ExceptionInInitializerError _)
+      {
+	// Ok.
+      }
+    try
+      {
+	System.out.println (fail.val ());
+      }
+    catch (NoClassDefFoundError _)
+      {
+	// Ok.
+      }
+  }
+}
Index: libjava.lang/initexc.out
===================================================================
RCS file: libjava.lang/initexc.out
diff -N libjava.lang/initexc.out



More information about the Java-patches mailing list