Skip to content

Commit e029c73

Browse files
committed
JavaP Disassembler Update
1 parent a094e52 commit e029c73

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

src/main/java/the/bytecode/club/bytecodeviewer/decompilers/impl/JavapDisassembler.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@
3131
import the.bytecode.club.bytecodeviewer.util.TempFile;
3232

3333
import java.io.File;
34-
import java.io.PrintWriter;
35-
import java.io.StringWriter;
3634
import java.lang.reflect.InvocationTargetException;
3735
import java.lang.reflect.Method;
3836
import java.net.URL;
@@ -69,7 +67,7 @@ public String decompileClassNode(ClassNode cn, byte[] bytes)
6967
private synchronized String disassembleJavaP(ClassNode cn, byte[] bytes)
7068
{
7169
TempFile tempFile = null;
72-
String exception = "This decompiler didn't throw an exception - this is probably a BCV logical bug";
70+
String exception;
7371

7472
JFrameConsolePrintStream sysOutBuffer;
7573

@@ -115,26 +113,29 @@ private synchronized String disassembleJavaP(ClassNode cn, byte[] bytes)
115113
}
116114
catch (IllegalAccessException e)
117115
{
116+
//TODO fallback using CLI (External Process API)
117+
118118
return TranslatedStrings.ILLEGAL_ACCESS_ERROR.toString();
119119
}
120120
catch (Throwable e)
121121
{
122-
exception = NL + NL + ExceptionUtils.exceptionToString(e);
122+
exception = ExceptionUtils.exceptionToString(e);
123123
}
124124
finally
125125
{
126126
BytecodeViewer.sm.silenceExec(false);
127127

128128
if(tempFile != null)
129-
tempFile.delete();
129+
tempFile.cleanup();
130130
}
131131

132-
return "JavaP " + ERROR + "! " + ExceptionUI.SEND_STACKTRACE_TO + NL + NL
132+
return getDecompilerName() + " " + ERROR + "! " + ExceptionUI.SEND_STACKTRACE_TO + NL + NL
133133
+ TranslatedStrings.SUGGESTED_FIX_DECOMPILER_ERROR + NL + NL + exception;
134134
}
135135

136136
@Override
137137
public void decompileToZip(String sourceJar, String zipName)
138138
{
139+
decompileToZipFallBack(sourceJar, zipName);
139140
}
140141
}

0 commit comments

Comments
 (0)