summaryrefslogtreecommitdiff
path: root/src/cuchaz
diff options
context:
space:
mode:
Diffstat (limited to 'src/cuchaz')
-rw-r--r--src/cuchaz/enigma/ExceptionIgnorer.java24
-rw-r--r--src/cuchaz/enigma/gui/Gui.java9
2 files changed, 30 insertions, 3 deletions
diff --git a/src/cuchaz/enigma/ExceptionIgnorer.java b/src/cuchaz/enigma/ExceptionIgnorer.java
new file mode 100644
index 0000000..37c67da
--- /dev/null
+++ b/src/cuchaz/enigma/ExceptionIgnorer.java
@@ -0,0 +1,24 @@
1package cuchaz.enigma;
2
3public class ExceptionIgnorer {
4
5 public static boolean shouldIgnore(Throwable t) {
6
7 // is this that pesky concurrent access bug in the highlight painter system?
8 // (ancient ui code is ancient)
9 if (t instanceof ArrayIndexOutOfBoundsException) {
10 StackTraceElement[] stackTrace = t.getStackTrace();
11 if (stackTrace.length > 1) {
12
13 // does this stack frame match javax.swing.text.DefaultHighlighter.paint() ?
14 StackTraceElement frame = stackTrace[1];
15 if (frame.getClassName().equals("javax.swing.text.DefaultHighlighter") && frame.getMethodName().equals("paint")) {
16 return true;
17 }
18 }
19 }
20
21 return false;
22 }
23
24}
diff --git a/src/cuchaz/enigma/gui/Gui.java b/src/cuchaz/enigma/gui/Gui.java
index 187ef5b..00cff59 100644
--- a/src/cuchaz/enigma/gui/Gui.java
+++ b/src/cuchaz/enigma/gui/Gui.java
@@ -70,6 +70,7 @@ import jsyntaxpane.DefaultSyntaxKit;
70import com.google.common.collect.Lists; 70import com.google.common.collect.Lists;
71 71
72import cuchaz.enigma.Constants; 72import cuchaz.enigma.Constants;
73import cuchaz.enigma.ExceptionIgnorer;
73import cuchaz.enigma.analysis.BehaviorReferenceTreeNode; 74import cuchaz.enigma.analysis.BehaviorReferenceTreeNode;
74import cuchaz.enigma.analysis.ClassImplementationsTreeNode; 75import cuchaz.enigma.analysis.ClassImplementationsTreeNode;
75import cuchaz.enigma.analysis.ClassInheritanceTreeNode; 76import cuchaz.enigma.analysis.ClassInheritanceTreeNode;
@@ -147,9 +148,11 @@ public class Gui {
147 CrashDialog.init(m_frame); 148 CrashDialog.init(m_frame);
148 Thread.setDefaultUncaughtExceptionHandler(new UncaughtExceptionHandler() { 149 Thread.setDefaultUncaughtExceptionHandler(new UncaughtExceptionHandler() {
149 @Override 150 @Override
150 public void uncaughtException(Thread thread, Throwable ex) { 151 public void uncaughtException(Thread thread, Throwable t) {
151 ex.printStackTrace(System.err); 152 t.printStackTrace(System.err);
152 CrashDialog.show(ex); 153 if (!ExceptionIgnorer.shouldIgnore(t)) {
154 CrashDialog.show(t);
155 }
153 } 156 }
154 }); 157 });
155 } 158 }