|
31 | 31 | import the.bytecode.club.bytecodeviewer.util.TempFile; |
32 | 32 |
|
33 | 33 | import java.io.File; |
34 | | -import java.io.PrintWriter; |
35 | | -import java.io.StringWriter; |
36 | 34 | import java.lang.reflect.InvocationTargetException; |
37 | 35 | import java.lang.reflect.Method; |
38 | 36 | import java.net.URL; |
@@ -69,7 +67,7 @@ public String decompileClassNode(ClassNode cn, byte[] bytes) |
69 | 67 | private synchronized String disassembleJavaP(ClassNode cn, byte[] bytes) |
70 | 68 | { |
71 | 69 | TempFile tempFile = null; |
72 | | - String exception = "This decompiler didn't throw an exception - this is probably a BCV logical bug"; |
| 70 | + String exception; |
73 | 71 |
|
74 | 72 | JFrameConsolePrintStream sysOutBuffer; |
75 | 73 |
|
@@ -115,26 +113,29 @@ private synchronized String disassembleJavaP(ClassNode cn, byte[] bytes) |
115 | 113 | } |
116 | 114 | catch (IllegalAccessException e) |
117 | 115 | { |
| 116 | + //TODO fallback using CLI (External Process API) |
| 117 | + |
118 | 118 | return TranslatedStrings.ILLEGAL_ACCESS_ERROR.toString(); |
119 | 119 | } |
120 | 120 | catch (Throwable e) |
121 | 121 | { |
122 | | - exception = NL + NL + ExceptionUtils.exceptionToString(e); |
| 122 | + exception = ExceptionUtils.exceptionToString(e); |
123 | 123 | } |
124 | 124 | finally |
125 | 125 | { |
126 | 126 | BytecodeViewer.sm.silenceExec(false); |
127 | 127 |
|
128 | 128 | if(tempFile != null) |
129 | | - tempFile.delete(); |
| 129 | + tempFile.cleanup(); |
130 | 130 | } |
131 | 131 |
|
132 | | - return "JavaP " + ERROR + "! " + ExceptionUI.SEND_STACKTRACE_TO + NL + NL |
| 132 | + return getDecompilerName() + " " + ERROR + "! " + ExceptionUI.SEND_STACKTRACE_TO + NL + NL |
133 | 133 | + TranslatedStrings.SUGGESTED_FIX_DECOMPILER_ERROR + NL + NL + exception; |
134 | 134 | } |
135 | 135 |
|
136 | 136 | @Override |
137 | 137 | public void decompileToZip(String sourceJar, String zipName) |
138 | 138 | { |
| 139 | + decompileToZipFallBack(sourceJar, zipName); |
139 | 140 | } |
140 | 141 | } |
0 commit comments