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: ClassLoader cleanup


I'm checking this in.

This changes the ClassLoader re-throwing code to use a chained
exception.  This makes the eventual stack trace more useful.

It also fixes indentation in resolveClass0.

Tom

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

	* java/lang/ClassLoader.java (resolveClass0): Set cause for
	newly-created exception.

Index: java/lang/ClassLoader.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/lang/ClassLoader.java,v
retrieving revision 1.18
diff -u -r1.18 ClassLoader.java
--- java/lang/ClassLoader.java 7 Aug 2002 05:28:24 -0000 1.18
+++ java/lang/ClassLoader.java 19 Sep 2002 17:41:55 -0000
@@ -432,17 +432,24 @@
   {
     synchronized (clazz)
       {
-	try {
-	  linkClass0 (clazz);
-	} catch (Throwable x) {
-	  markClassErrorState0 (clazz);
+	try
+	  {
+	    linkClass0 (clazz);
+	  }
+	catch (Throwable x)
+	  {
+	    markClassErrorState0 (clazz);
 
-	  if (x instanceof Error)
-	    throw (Error)x;
-	  else    
-	    throw new java.lang.InternalError
-	      ("unexpected exception during linking: " + x);
-	}
+	    if (x instanceof Error)
+	      throw (Error)x;
+	    else
+	      {
+		InternalError e
+		  = new InternalError ("unexpected exception during linking");
+		e.initCause (x);
+		throw e;
+	      }
+	  }
       }
   }
 


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