diff options
| author | 2015-02-10 22:23:12 -0500 | |
|---|---|---|
| committer | 2015-02-10 22:23:12 -0500 | |
| commit | c6a194dcf933dd7a4e2bf6b92bcb417957aba765 (patch) | |
| tree | c0a4b7ddfd87421b94e77bbcd9e607e67a2dc4f8 /src/cuchaz/enigma/ExceptionIgnorer.java | |
| parent | add BRIDGE flag to bridge methods (diff) | |
| download | enigma-fork-c6a194dcf933dd7a4e2bf6b92bcb417957aba765.tar.gz enigma-fork-c6a194dcf933dd7a4e2bf6b92bcb417957aba765.tar.xz enigma-fork-c6a194dcf933dd7a4e2bf6b92bcb417957aba765.zip | |
ignore harmless exceptions I can't fix
fyi, it's really hard to test this fix because the exception is not generally reproducable
Diffstat (limited to 'src/cuchaz/enigma/ExceptionIgnorer.java')
| -rw-r--r-- | src/cuchaz/enigma/ExceptionIgnorer.java | 24 |
1 files changed, 24 insertions, 0 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 @@ | |||
| 1 | package cuchaz.enigma; | ||
| 2 | |||
| 3 | public 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 | } | ||