* @param message the error message.
* @param exception the exception that occurred.
*/
- public static void handleErrorCondition(String message, Exception exception) {
+ public static void handleErrorCondition(String message, Throwable exception) {
log.error(1, message, exception);
handleErrorCondition(new InternalException(message, exception));
}
*
* @param exception the exception that occurred.
*/
- public static void handleErrorCondition(final Exception exception) {
+ public static void handleErrorCondition(final Throwable exception) {
try {
if (!(exception instanceof InternalException)) {
log.error(1, "Error occurred", exception);
log.info("Running in EDT, showing dialog");
handler.showDialog(thread, exception);
} else {
- log.info("Not in EDT, invoking and waiting for dialog");
- SwingUtilities.invokeAndWait(new Runnable() {
+ log.info("Not in EDT, invoking dialog later");
+ SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
handler.showDialog(thread, exception);
}
// Unknown Error
- if (!(e instanceof Exception)) {
+ if (!(e instanceof Exception) && !(e instanceof LinkageError)) {
log.info("Showing Error dialog");
JOptionPane.showMessageDialog(null,
new Object[] {
}
}
+
+ /*
+ * Detect and ignore bug 6933331 in Sun JRE 1.6.0_18 and others
+ */
+ if (t instanceof IllegalStateException) {
+ StackTraceElement[] trace = t.getStackTrace();
+
+ if (trace.length > 1 &&
+ trace[0].getClassName().equals("sun.awt.windows.WComponentPeer") &&
+ trace[0].getMethodName().equals("getBackBuffer")) {
+ log.warn("Ignoring Sun JRE bug 6933331 " +
+ "(see http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6933331): " + t);
+ return true;
+ }
+ }
+
/*
* Detect and ignore bug in Sun JRE 1.6.0_19
*/