--- a/hotspot/src/share/vm/utilities/exceptions.cpp Tue Mar 15 15:29:42 2016 +0100
+++ b/hotspot/src/share/vm/utilities/exceptions.cpp Tue Mar 15 15:43:04 2016 -0400
@@ -52,11 +52,11 @@
}
void ThreadShadow::clear_pending_exception() {
- if (TraceClearedExceptions) {
- if (_pending_exception != NULL) {
- tty->print_cr("Thread::clear_pending_exception: cleared exception:");
- _pending_exception->print();
- }
+ if (_pending_exception != NULL && log_is_enabled(Debug, exceptions)) {
+ ResourceMark rm;
+ outputStream* logst = LogHandle(exceptions)::debug_stream();
+ logst->print("Thread::clear_pending_exception: cleared exception:");
+ _pending_exception->print_on(logst);
}
_pending_exception = NULL;
_exception_file = NULL;