--- a/hotspot/src/share/vm/runtime/thread.cpp Tue Feb 08 09:11:37 2011 -0800
+++ b/hotspot/src/share/vm/runtime/thread.cpp Tue Feb 08 22:27:57 2011 -0800
@@ -1595,7 +1595,15 @@
uncaught_exception, // Arg 2
THREAD);
}
- CLEAR_PENDING_EXCEPTION;
+ if (HAS_PENDING_EXCEPTION) {
+ ResourceMark rm(this);
+ jio_fprintf(defaultStream::error_stream(),
+ "\nException: %s thrown from the UncaughtExceptionHandler"
+ " in thread \"%s\"\n",
+ Klass::cast(pending_exception()->klass())->external_name(),
+ get_thread_name());
+ CLEAR_PENDING_EXCEPTION;
+ }
}
}