ClassLoader.java (resolveClass0): Set cause for newly-created exception.
authorTom Tromey <tromey@redhat.com>
Thu, 19 Sep 2002 17:44:49 +0000 (17:44 +0000)
committerTom Tromey <tromey@gcc.gnu.org>
Thu, 19 Sep 2002 17:44:49 +0000 (17:44 +0000)
* java/lang/ClassLoader.java (resolveClass0): Set cause for
newly-created exception.

From-SVN: r57310

libjava/ChangeLog
libjava/java/lang/ClassLoader.java

index 89cba058fbeba875624a703a38123e8ab953bb7f..24bd7ac944464accd2e776c7ed00e60e4deebeff 100644 (file)
@@ -1,3 +1,8 @@
+2002-09-19  Tom Tromey  <tromey@redhat.com>
+
+       * java/lang/ClassLoader.java (resolveClass0): Set cause for
+       newly-created exception.
+
 2002-09-18  Michael Koch  <konqueror@gmx.de>
 
        * java/util/regex/Matcher.java, java/util/regex/Pattern.java,
index a6faa61b2ed8953f656f3fbe354b3d44a15ce0df..2c0e21133d961e6e926932369c91f055a6071883 100644 (file)
@@ -432,17 +432,24 @@ public abstract class ClassLoader
   {
     synchronized (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);
-       }
+       try
+         {
+           linkClass0 (clazz);
+         }
+       catch (Throwable x)
+         {
+           markClassErrorState0 (clazz);
+
+           if (x instanceof Error)
+             throw (Error)x;
+           else
+             {
+               InternalError e
+                 = new InternalError ("unexpected exception during linking");
+               e.initCause (x);
+               throw e;
+             }
+         }
       }
   }