diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/plugin/PluginWriter.java b/src/main/java/the/bytecode/club/bytecodeviewer/plugin/PluginWriter.java index 2ecfa99ee..294382b77 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/plugin/PluginWriter.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/plugin/PluginWriter.java @@ -12,6 +12,7 @@ import javax.swing.JMenuBar; import javax.swing.JMenuItem; import javax.swing.JPanel; +import com.google.common.io.Files; import me.konloch.kontainer.io.DiskReader; import me.konloch.kontainer.io.DiskWriter; import org.apache.commons.compress.utils.FileNameUtils; @@ -188,7 +189,7 @@ public void runPlugin() try { //write to temporary file location - DiskWriter.replaceFile(tempFile.getAbsolutePath(), area.getText(), false); + Files.copy(savePath, tempFile); //run plugin from that location PluginManager.runPlugin(tempFile); } diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/plugin/strategies/CompiledJavaPluginLaunchStrategy.java b/src/main/java/the/bytecode/club/bytecodeviewer/plugin/strategies/CompiledJavaPluginLaunchStrategy.java index 110f76b5c..b81910447 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/plugin/strategies/CompiledJavaPluginLaunchStrategy.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/plugin/strategies/CompiledJavaPluginLaunchStrategy.java @@ -51,7 +51,7 @@ public Plugin run(File file) throws Throwable { LoadedNodeData pdata = null; for (LoadedNodeData d : set) { ClassNode cn = d.node; - if (cn.superName.equals(PLUGIN_CLASS_NAME)) { + if (Objects.equals(cn.superName, PLUGIN_CLASS_NAME)) { if (pdata == null) { pdata = d; } else {