Skip to content

Commit bf1faa9

Browse files
authored
Merge pull request #374 from ThexXTURBOXx/master
Fix closed stream for Procyon
2 parents 713edc0 + 1f009d5 commit bf1faa9

1 file changed

Lines changed: 14 additions & 14 deletions

File tree

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

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,9 @@
6868
* @author Konloch
6969
* @author DeathMarine
7070
*/
71-
public class ProcyonDecompiler extends InternalDecompiler
72-
{
73-
public DecompilerSettings getDecompilerSettings()
74-
{
71+
public class ProcyonDecompiler extends InternalDecompiler {
72+
73+
public DecompilerSettings getDecompilerSettings() {
7574
DecompilerSettings settings = new DecompilerSettings();
7675
settings.setAlwaysGenerateExceptionVariableForCatchBlocks(BytecodeViewer.viewer.alwaysGenerateExceptionVars.isSelected());
7776
settings.setExcludeNestedTypes(BytecodeViewer.viewer.excludeNestedTypes.isSelected());
@@ -118,7 +117,7 @@ public String decompileClassNode(ClassNode cn, byte[] b) {
118117
TypeDefinition resolvedType;
119118
if (type == null || ((resolvedType = type.resolve()) == null))
120119
throw new Exception("Unable to resolve type.");
121-
120+
122121
StringWriter stringwriter = new StringWriter();
123122
settings.getLanguage().decompileType(resolvedType, new PlainTextOutput(stringwriter), decompilationOptions);
124123

@@ -130,7 +129,7 @@ public String decompileClassNode(ClassNode cn, byte[] b) {
130129

131130
exception = ExceptionUI.SEND_STACKTRACE_TO_NL + sw;
132131
}
133-
132+
134133
return PROCYON + " " + ERROR + "! " + ExceptionUI.SEND_STACKTRACE_TO +
135134
nl + nl + TranslatedStrings.SUGGESTED_FIX_DECOMPILER_ERROR +
136135
nl + nl + exception;
@@ -184,12 +183,11 @@ private void doSaveJarDecompiled(File inFile, File outFile)
184183
|| ((resolvedType = type.resolve()) == null)) {
185184
throw new Exception("Unable to resolve type.");
186185
}
187-
try (Writer writer = new OutputStreamWriter(out)) {
188-
settings.getLanguage().decompileType(resolvedType,
189-
new PlainTextOutput(writer),
190-
decompilationOptions);
191-
writer.flush();
192-
}
186+
Writer writer = new OutputStreamWriter(out);
187+
settings.getLanguage().decompileType(resolvedType,
188+
new PlainTextOutput(writer),
189+
decompilationOptions);
190+
writer.flush();
193191
} finally {
194192
out.closeEntry();
195193
}
@@ -212,8 +210,7 @@ private void doSaveJarDecompiled(File inFile, File outFile)
212210
out.closeEntry();
213211
}
214212
} catch (ZipException ze) {
215-
// some jar-s contain duplicate pom.xml entries: ignore
216-
// it
213+
// some jars contain duplicate pom.xml entries: ignore it
217214
if (!ze.getMessage().contains("duplicate")) {
218215
throw ze;
219216
}
@@ -227,6 +224,7 @@ private void doSaveJarDecompiled(File inFile, File outFile)
227224
* @author DeathMarine
228225
*/
229226
public static final class LuytenTypeLoader implements ITypeLoader {
227+
230228
private final List<ITypeLoader> _typeLoaders;
231229

232230
public LuytenTypeLoader() {
@@ -251,5 +249,7 @@ public boolean tryLoadType(final String internalName,
251249

252250
return false;
253251
}
252+
254253
}
254+
255255
}

0 commit comments

Comments
 (0)