General code quality changes

This commit is contained in:
Nico Mexis 2022-02-25 15:52:53 +01:00
parent 8e80a0b439
commit 4ccfb6021f
No known key found for this signature in database
GPG Key ID: 27D6E17CE092AB78
3 changed files with 4 additions and 8 deletions

View File

@ -64,7 +64,7 @@ public class DiskReader {
try (FileReader fr = new FileReader(fileName);
BufferedReader reader = new BufferedReader(fr)) {
for (String add = reader.readLine(); add != null; add = reader.readLine()) {
s.append(EncodeUtils.unicodeToString(add)).append(System.getProperty("line.separator"));
s.append(EncodeUtils.unicodeToString(add)).append(System.lineSeparator());
}
}

View File

@ -79,7 +79,7 @@ public class RunOptions extends JFrame
getContentPane().add(mainMethodFQN);
mainMethodFQN.setColumns(10);
JLabel lblNewLabel = new JLabel("Debug Classes (Seperate with , ):");
JLabel lblNewLabel = new JLabel("Debug Classes (Separated with , ):");
lblNewLabel.setBounds(10, 89, 228, 14);
getContentPane().add(lblNewLabel);

View File

@ -1,7 +1,6 @@
package the.bytecode.club.bytecodeviewer.plugin.strategies;
import java.io.File;
import me.konloch.kontainer.io.DiskReader;
import org.codehaus.janino.SimpleCompiler;
import the.bytecode.club.bytecodeviewer.api.Plugin;
import the.bytecode.club.bytecodeviewer.plugin.PluginLaunchStrategy;
@ -35,13 +34,10 @@ public class JavaPluginLaunchStrategy implements PluginLaunchStrategy
@Override
public Plugin run(File file) throws Throwable
{
SimpleCompiler compiler = new SimpleCompiler();
//compile the Java source
compiler.cook(DiskReader.loadAsString(file.getAbsolutePath()));
SimpleCompiler compiler = new SimpleCompiler(file.getCanonicalPath());
//debug
System.out.println(file.getName().substring(0, file.getName().length() - (".java".length())));
//System.out.println(file.getName().substring(0, file.getName().length() - (".java".length())));
//get the class object from the compiler classloader
Class<?> clazz = Class.forName(