classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

PATCH: Print thread name on uncaught exception


From: Bryce McKinlay
Subject: PATCH: Print thread name on uncaught exception
Date: Wed, 25 Oct 2000 00:00:19 +1300

Recent JDKs have a nice feature whereby they print the name of the
thread alongside the stack trace for an uncaught exception. This patch
implements the same for gcj/classpath. I'm checking it in.

regards

  [ bryce ]


2000-10-24  Bryce McKinlay  <address@hidden>

        * java/lang/ThreadGroup.java (uncaughtException): Print thread name
        with stack dump.

Index: ThreadGroup.java
===================================================================
RCS file: /cvs/java/libgcj/libjava/java/lang/ThreadGroup.java,v
retrieving revision 1.10
diff -u -r1.10 ThreadGroup.java
--- ThreadGroup.java    2000/09/13 06:36:25     1.10
+++ ThreadGroup.java    2000/10/24 10:54:23
@@ -500,6 +500,8 @@
       parent.uncaughtException (thread, t);
     else if (! (t instanceof ThreadDeath))
       {
+        if (thread != null)
+          System.out.print("Exception in thread \"" + thread.getName() + "\" 
");
        t.printStackTrace();
        had_uncaught_exception = true;
       }

reply via email to

[Prev in Thread] Current Thread [Next in Thread]