diff options
Diffstat (limited to 'src/main/java/cuchaz/enigma/ExceptionIgnorer.java')
| -rw-r--r-- | src/main/java/cuchaz/enigma/ExceptionIgnorer.java | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/src/main/java/cuchaz/enigma/ExceptionIgnorer.java b/src/main/java/cuchaz/enigma/ExceptionIgnorer.java index fc89fa6..84331cc 100644 --- a/src/main/java/cuchaz/enigma/ExceptionIgnorer.java +++ b/src/main/java/cuchaz/enigma/ExceptionIgnorer.java | |||
| @@ -8,27 +8,28 @@ | |||
| 8 | * Contributors: | 8 | * Contributors: |
| 9 | * Jeff Martin - initial API and implementation | 9 | * Jeff Martin - initial API and implementation |
| 10 | ******************************************************************************/ | 10 | ******************************************************************************/ |
| 11 | |||
| 11 | package cuchaz.enigma; | 12 | package cuchaz.enigma; |
| 12 | 13 | ||
| 13 | public class ExceptionIgnorer { | 14 | public class ExceptionIgnorer { |
| 14 | 15 | ||
| 15 | public static boolean shouldIgnore(Throwable t) { | 16 | public static boolean shouldIgnore(Throwable t) { |
| 16 | 17 | ||
| 17 | // is this that pesky concurrent access bug in the highlight painter system? | 18 | // is this that pesky concurrent access bug in the highlight painter system? |
| 18 | // (ancient ui code is ancient) | 19 | // (ancient ui code is ancient) |
| 19 | if (t instanceof ArrayIndexOutOfBoundsException) { | 20 | if (t instanceof ArrayIndexOutOfBoundsException) { |
| 20 | StackTraceElement[] stackTrace = t.getStackTrace(); | 21 | StackTraceElement[] stackTrace = t.getStackTrace(); |
| 21 | if (stackTrace.length > 1) { | 22 | if (stackTrace.length > 1) { |
| 22 | 23 | ||
| 23 | // does this stack frame match javax.swing.text.DefaultHighlighter.paint*() ? | 24 | // does this stack frame match javax.swing.text.DefaultHighlighter.paint*() ? |
| 24 | StackTraceElement frame = stackTrace[1]; | 25 | StackTraceElement frame = stackTrace[1]; |
| 25 | if (frame.getClassName().equals("javax.swing.text.DefaultHighlighter") && frame.getMethodName().startsWith("paint")) { | 26 | if (frame.getClassName().equals("javax.swing.text.DefaultHighlighter") && frame.getMethodName().startsWith("paint")) { |
| 26 | return true; | 27 | return true; |
| 27 | } | 28 | } |
| 28 | } | 29 | } |
| 29 | } | 30 | } |
| 30 | 31 | ||
| 31 | return false; | 32 | return false; |
| 32 | } | 33 | } |
| 33 | 34 | ||
| 34 | } | 35 | } |