This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Patch: FYI: ClassLoader cleanup
- From: Tom Tromey <tromey at redhat dot com>
- To: Java Patch List <java-patches at gcc dot gnu dot org>
- Date: 19 Sep 2002 11:40:19 -0600
- Subject: Patch: FYI: ClassLoader cleanup
- Reply-to: tromey at redhat dot com
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;
+ }
+ }
}
}