This is the mail archive of the
java-patches@sources.redhat.com
mailing list for the Java project.
PATCH: Print thread name on uncaught exception
- To: java-patches at sourceware dot cygnus dot com, classpath at gnu dot org
- Subject: PATCH: Print thread name on uncaught exception
- From: Bryce McKinlay <bryce at albatross dot co dot nz>
- 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 <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;
}