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]

Two small patches


Hi,

The following two small patches make some exceptions a bit clearer and
remove a compiler warning about an unused function argument variable.

2002-11-10  Mark Wielaard  <mark@klomp.org>

        * java/lang/natClass.cc (initializeClass): Throw NoClassDefFoundError 
        with getName() as message.
        (_Jv_CheckArrayStore): Throw ArrayStoreException with object and array
        type as message.

        * java/lang/natVMThrowable.cc: Don't declare parameter t, it is
        unused.

OK to commit?

Cheers,

Mark
Index: java/lang/natClass.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/lang/natClass.cc,v
retrieving revision 1.54
diff -u -r1.54 natClass.cc
--- java/lang/natClass.cc	2 Nov 2002 23:52:56 -0000	1.54
+++ java/lang/natClass.cc	10 Nov 2002 20:17:50 -0000
@@ -751,7 +751,7 @@
   if (state == JV_STATE_ERROR)
     {
       _Jv_MonitorExit (this);
-      throw new java::lang::NoClassDefFoundError;
+      throw new java::lang::NoClassDefFoundError (getName());
     }
 
   // Step 6.
@@ -1043,7 +1043,12 @@
       jclass obj_class = JV_CLASS (obj);
       if (__builtin_expect 
           (! _Jv_IsAssignableFrom (elt_class, obj_class), false))
-	throw new java::lang::ArrayStoreException;
+	throw new java::lang::ArrayStoreException
+		((new java::lang::StringBuffer
+		 (JvNewStringUTF("Cannot store ")))->append
+		 (obj_class->getName())->append
+		 (JvNewStringUTF(" in array of type "))->append
+		 (elt_class->getName())->toString());
     }
 }
 
Index: java/lang/natVMThrowable.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/lang/natVMThrowable.cc,v
retrieving revision 1.3
diff -u -r1.3 natVMThrowable.cc
--- java/lang/natVMThrowable.cc	2 Sep 2002 15:55:57 -0000	1.3
+++ java/lang/natVMThrowable.cc	10 Nov 2002 20:17:50 -0000
@@ -44,7 +44,7 @@
    arbitrary.  It may be better to configure this.  */
 
 java::lang::VMThrowable *
-java::lang::VMThrowable::fillInStackTrace (java::lang::Throwable* t)
+java::lang::VMThrowable::fillInStackTrace (java::lang::Throwable*)
 {
   if (! trace_enabled)
     return NULL;

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