Skip to content

Commit 7a428a3

Browse files
committed
refactor: move parseException to MovedStatics
1 parent d35c6e1 commit 7a428a3

File tree

2 files changed

+42
-44
lines changed

2 files changed

+42
-44
lines changed
Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,8 @@
11
package org.runejs.client;
22

3-
import java.io.*;
4-
53
public class Class55 {
64
public static volatile int eventClickX = 0;
75
public static int destinationY = 0;
86

9-
public static String parseException(Throwable exception) throws IOException {
10-
String string;
11-
if(exception instanceof RSRuntimeException) {
12-
RSRuntimeException runtimeexception_sub1 = (RSRuntimeException) exception;
13-
string = runtimeexception_sub1.aString1653 + " | ";
14-
exception = runtimeexception_sub1.aThrowable1652;
15-
} else
16-
string = "";
17-
StringWriter stringwriter = new StringWriter();
18-
PrintWriter printwriter = new PrintWriter(stringwriter);
19-
exception.printStackTrace(printwriter);
20-
printwriter.close();
21-
String string_0_ = stringwriter.toString();
22-
BufferedReader bufferedreader = new BufferedReader(new StringReader(string_0_));
23-
String string_1_ = bufferedreader.readLine();
24-
for(; ; ) {
25-
String string_2_ = bufferedreader.readLine();
26-
if(string_2_ == null)
27-
break;
28-
int i = string_2_.indexOf('(');
29-
int i_3_ = string_2_.indexOf(')', i + 1);
30-
if(i >= 0 && i_3_ >= 0) {
31-
String string_4_ = string_2_.substring(1 + i, i_3_);
32-
int i_5_ = string_4_.indexOf(".java:");
33-
if(i_5_ >= 0) {
34-
string_4_ = string_4_.substring(0, i_5_) + string_4_.substring(5 + i_5_);
35-
string += string_4_ + ' ';
36-
continue;
37-
}
38-
string_2_ = string_2_.substring(0, i);
39-
}
40-
string_2_ = string_2_.trim();
41-
string_2_ = string_2_.substring(1 + string_2_.lastIndexOf(' '));
42-
string_2_ = string_2_.substring(1 + string_2_.lastIndexOf('\t'));
43-
string += string_2_ + ' ';
44-
}
45-
string += "| " + string_1_;
46-
return string;
47-
}
48-
497

508
}

src/main/java/org/runejs/client/MovedStatics.java

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
import org.runejs.Configuration;
4545

4646
import java.awt.*;
47-
import java.io.DataInputStream;
47+
import java.io.*;
4848
import java.net.URL;
4949
import java.nio.charset.StandardCharsets;
5050
import java.text.MessageFormat;
@@ -565,7 +565,7 @@ public static void printException(String arg0, Throwable exception) {
565565
try {
566566
String string = "";
567567
if (exception != null)
568-
string = Class55.parseException(exception);
568+
string = parseException(exception);
569569
if (arg0 != null) {
570570
if (exception != null)
571571
string += " | ";
@@ -2756,4 +2756,44 @@ public static void drawTabGraphics() {
27562756
MouseHandler.gameCanvas.repaint();
27572757
}
27582758
}
2759+
2760+
public static String parseException(Throwable exception) throws IOException {
2761+
String string;
2762+
if(exception instanceof RSRuntimeException) {
2763+
RSRuntimeException runtimeexception_sub1 = (RSRuntimeException) exception;
2764+
string = runtimeexception_sub1.aString1653 + " | ";
2765+
exception = runtimeexception_sub1.aThrowable1652;
2766+
} else
2767+
string = "";
2768+
StringWriter stringwriter = new StringWriter();
2769+
PrintWriter printwriter = new PrintWriter(stringwriter);
2770+
exception.printStackTrace(printwriter);
2771+
printwriter.close();
2772+
String string_0_ = stringwriter.toString();
2773+
BufferedReader bufferedreader = new BufferedReader(new StringReader(string_0_));
2774+
String string_1_ = bufferedreader.readLine();
2775+
for(; ; ) {
2776+
String string_2_ = bufferedreader.readLine();
2777+
if(string_2_ == null)
2778+
break;
2779+
int i = string_2_.indexOf('(');
2780+
int i_3_ = string_2_.indexOf(')', i + 1);
2781+
if(i >= 0 && i_3_ >= 0) {
2782+
String string_4_ = string_2_.substring(1 + i, i_3_);
2783+
int i_5_ = string_4_.indexOf(".java:");
2784+
if(i_5_ >= 0) {
2785+
string_4_ = string_4_.substring(0, i_5_) + string_4_.substring(5 + i_5_);
2786+
string += string_4_ + ' ';
2787+
continue;
2788+
}
2789+
string_2_ = string_2_.substring(0, i);
2790+
}
2791+
string_2_ = string_2_.trim();
2792+
string_2_ = string_2_.substring(1 + string_2_.lastIndexOf(' '));
2793+
string_2_ = string_2_.substring(1 + string_2_.lastIndexOf('\t'));
2794+
string += string_2_ + ' ';
2795+
}
2796+
string += "| " + string_1_;
2797+
return string;
2798+
}
27592799
}

0 commit comments

Comments
 (0)