-
Bug
-
Resolution: Fixed
-
P3
-
6u7, 6u10, 7
-
b48
-
x86
-
windows_xp
-
Verified
java version "1.6.0_07"
Java(TM) SE Runtime Environment (build 1.6.0_07-b06)
Java HotSpot(TM) Client VM (build 10.0-b23, mixed mode, sharing)
Does this problem occur on J2SE 5.0.x or 6.0? Yes / No (pick one)
Yes
Operating System Configuration Information (be specific):
Microsoft Windows XP [Version 5.1.2600]
Bug Description:
Regression: Some Uncaught Exceptions are no longer getting sent to the Uncaught Exception Handlers
In 1.4(merlin-beta) problem 4063022 was addressed such that the Uncaught Exceptions
would be sent to the Uncaught Exception Handlers
In 1.4(merlin-beta3) due to report 4499199 this was broken again such that during
a modal dialog Uncaught Exceptions would not be sent to the Uncaught Exception Handlers
The EventDispatchThread.processException makes note of this and states that: It may be
useful to add either a runtime flag or API later if someone would like to instead
dispose the dialog and allow the thread group to handle it.
However all the bugs relating to this seem to have been closed as fixed even though
this problem still exists in 1.6.0_07.
The fix should be very simple replace the EventDispatchThread.processException code
with this:
Thread thread = Thread.currentThread();
thread.getUncaughtExceptionHandler().uncaughtException(thread, e);
And change the UncaughtExceptionHandler JavaDoc slightly as in this case the Thread
wont be terminated.
It is not clear why one Event Queue Thread would be terminated and then another one
started doing the same thing when not isModal (the problematic event has already been
removed from the queue), however if there really is a need for this then just the if
(isModal) section of EventDispatchThread.processException can be replaced with the
above code.
- duplicates
-
JDK-6791501 Official API for Swing EDT Exception Handler
- Closed
- relates to
-
JDK-6304473 ThreadGroup.uncaughtExceptionHandler doesn't work
- Closed
-
JDK-4887645 Remove "awt.threadgroup" system property
- Closed
-
JDK-6847599 closed/java/awt/EventDispatchThread/ExceptionHandler.java fails
- Closed
-
JDK-4714232 RFE: replace sun.awt.exception.handler system property with official API
- Resolved
-
JDK-4499199 Modal dialog doesn't handle exceptions correctly
- Resolved
-
JDK-4063022 RFE: Awt ThreadGroup catches all UncaughtExceptions
- Resolved