From 36e6dbf875a195c98c3eb73020b9f695b4a86a18 Mon Sep 17 00:00:00 2001 From: Konloch Date: Wed, 2 Oct 2024 12:26:19 -0600 Subject: [PATCH] FernFlower Decompiler Improvements --- .../impl/FernFlowerDecompiler.java | 21 +++++++------------ 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/impl/FernFlowerDecompiler.java b/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/impl/FernFlowerDecompiler.java index 08b00411..fc42ace7 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/impl/FernFlowerDecompiler.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/impl/FernFlowerDecompiler.java @@ -126,18 +126,9 @@ public class FernFlowerDecompiler extends AbstractDecompiler //if the output file is found, read it if (tempOutputJavaFile.exists()) - { - String javaSource = DiskReader.loadAsString(tempOutputJavaFile.getAbsolutePath()); - - //cleanup temp files - tempFile.delete(); - - return javaSource; - } + return DiskReader.loadAsString(tempOutputJavaFile.getAbsolutePath()); else - { exception = "BCV Error: " + tempOutputJavaFile.getAbsolutePath() + " does not exist."; - } } catch (Exception e) { @@ -147,10 +138,12 @@ public class FernFlowerDecompiler extends AbstractDecompiler exception += NL + NL + exceptionWriter; } - - //cleanup temp files - if(tempFile != null) - tempFile.delete(); + finally + { + //cleanup temp files + if(tempFile != null) + tempFile.delete(); + } return FERNFLOWER + " " + ERROR + "! " + ExceptionUI.SEND_STACKTRACE_TO + NL + NL + TranslatedStrings.SUGGESTED_FIX_DECOMPILER_ERROR + NL + NL + exception;