Skip to content

Commit f8fd267

Browse files
committed
Fix procyon
1 parent b4d05f5 commit f8fd267

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

src/main/java/the/bytecode/club/jda/decompilers/ProcyonDecompiler.java

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,7 @@
1414
import the.bytecode.club.jda.JarUtils;
1515

1616
import java.io.*;
17-
import java.util.Enumeration;
18-
import java.util.HashSet;
19-
import java.util.Map;
20-
import java.util.Set;
17+
import java.util.*;
2118
import java.util.jar.JarEntry;
2219
import java.util.jar.JarFile;
2320
import java.util.zip.ZipException;
@@ -46,13 +43,13 @@ public String getName() {
4643
public DecompilerSettings getDecompilerSettings() {
4744
CommandLineOptions options = new CommandLineOptions();
4845
JCommander jCommander = new JCommander(options);
49-
String[] args = new String[Settings.values().length * 2];
50-
int index = 0;
51-
for (the.bytecode.club.jda.settings.DecompilerSettings.Setting setting : Settings.values()) {
52-
args[index++] = "--" + setting.getParam();
53-
args[index++] = String.valueOf(getSettings().isSelected(setting));
54-
}
55-
jCommander.parse(args);
46+
List<String> args = new ArrayList<>();
47+
for (the.bytecode.club.jda.settings.DecompilerSettings.Setting setting : Settings.values())
48+
if (getSettings().isSelected(setting))
49+
args.add("--" + setting.getParam());
50+
String[] argsArr = new String[args.size()];
51+
args.toArray(argsArr);
52+
jCommander.parse(argsArr);
5653
DecompilerSettings settings = new DecompilerSettings();
5754
settings.setFlattenSwitchBlocks(options.getFlattenSwitchBlocks());
5855
settings.setForceExplicitImports(!options.getCollapseImports());

0 commit comments

Comments
 (0)