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]

FYI: java.awt.Toolkit initialization patchlet


Hi,

This makes it much easier to see what really went wrong when
initializing the AWT Toolkit.

2003-06-06  Mark Wielaard  <mark@klomp.org>

       * java/awt/Toolkit.java (getDefaultToolkit): Add exception cause to
       AWTError.


Cheers,

Mark
Index: java/awt/Toolkit.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/awt/Toolkit.java,v
retrieving revision 1.21
diff -u -r1.21 Toolkit.java
--- java/awt/Toolkit.java	24 Mar 2003 13:50:32 -0000	1.21
+++ java/awt/Toolkit.java	6 Jun 2003 13:09:32 -0000
@@ -496,9 +496,10 @@
         toolkit = (Toolkit) obj;
         return toolkit;
       }
-    catch (Exception e)
+    catch (Throwable t)
       {
-        throw new AWTError("Cannot load AWT toolkit: " + e.getMessage());
+	AWTError e = new AWTError("Cannot load AWT toolkit: " + toolkit_name);
+	throw (AWTError) e.initCause(t);
       }
   }
 

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