This is the mail archive of the java-patches@sources.redhat.com 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]

PATCH: Print thread name on uncaught exception


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  <bryce@albatross.co.nz>

	* 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;
       }

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