OSDN Git Service

More for PR java/5365:
authortromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 16 Jan 2002 21:18:36 +0000 (21:18 +0000)
committertromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 16 Jan 2002 21:18:36 +0000 (21:18 +0000)
* gjavah.c (print_stub_or_jni): Cause exception to be thrown by
default.
(process_file): Generate include for
java.lang.UnsupportedOperationExceptions.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@48928 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/java/ChangeLog
gcc/java/gjavah.c

index 106eda8..f150a4d 100644 (file)
@@ -1,3 +1,11 @@
+2002-01-16  Tom Tromey  <tromey@redhat.com>
+
+       More for PR java/5365:
+       * gjavah.c (print_stub_or_jni): Cause exception to be thrown by
+       default.
+       (process_file): Generate include for
+       java.lang.UnsupportedOperationExceptions.
+
 2002-01-15  Andreas Jaeger  <aj@suse.de>
 
        * .cvsignore: Add man pages.
index d5de1eb..b128ab7 100644 (file)
@@ -1503,12 +1503,13 @@ DEFUN(print_stub_or_jni, (stream, jcf, name_index, signature_index, is_init,
          if (flag_jni)
            fputs ("\n{\n  (*env)->FatalError (\"", stream);
          else
-           fputs ("\n{\n  JvFail (\"", stream);
+           fputs ("\n{\n  throw new ::java::lang::UnsupportedOperationException (JvNewStringLatin1 (\"", stream);
          print_name_for_stub_or_jni (stream, jcf, name_index,
                                      signature_index, is_init,
                                      name_override,
                                      flags);
-         fputs (" not implemented\");\n}\n\n", stream);
+         fprintf (stream, " not implemented\")%s;\n}\n\n",
+                  flag_jni ? "" : ")");
        }
     }
 }
@@ -1982,7 +1983,11 @@ DEFUN(process_file, (jcf, out),
          free (name);
 
          if (! flag_jni)
-           print_include (out, "gcj/cni", -1);
+           {
+             print_include (out, "gcj/cni", -1);
+             print_include (out, "java/lang/UnsupportedOperationException",
+                            -1);
+           }
        }
     }