summaryrefslogtreecommitdiff
path: root/src/main/java/cuchaz/enigma/ExceptionIgnorer.java
diff options
context:
space:
mode:
authorGravatar Thog2017-03-08 08:17:04 +0100
committerGravatar Thog2017-03-08 08:17:04 +0100
commit6e464ea251cab63c776ece0b2a356f1498ffa294 (patch)
tree5ed30c03f5ac4cd2d6877874f5ede576049954f7 /src/main/java/cuchaz/enigma/ExceptionIgnorer.java
parentDrop unix case style and implement hashCode when equals is overrided (diff)
downloadenigma-fork-6e464ea251cab63c776ece0b2a356f1498ffa294.tar.gz
enigma-fork-6e464ea251cab63c776ece0b2a356f1498ffa294.tar.xz
enigma-fork-6e464ea251cab63c776ece0b2a356f1498ffa294.zip
Follow Fabric guidelines
Diffstat (limited to 'src/main/java/cuchaz/enigma/ExceptionIgnorer.java')
-rw-r--r--src/main/java/cuchaz/enigma/ExceptionIgnorer.java31
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
11package cuchaz.enigma; 12package cuchaz.enigma;
12 13
13public class ExceptionIgnorer { 14public 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}