Skip to content

Commit e0134fd

Browse files
committed
Change BY_NAME back to Map
1 parent 9725c41 commit e0134fd

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
public abstract class Decompiler {
1818
public Decompiler() {
19-
Decompilers.BY_NAME.add(this);
19+
Decompilers.BY_NAME.put(getName(), this);
2020
}
2121

2222
protected DecompilerSettings settings = new DecompilerSettings(this);

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
import the.bytecode.club.jda.decompilers.bytecode.ClassNodeDecompiler;
44

5-
import java.util.ArrayList;
65
import java.util.Collection;
76
import java.util.Collections;
8-
import java.util.List;
7+
import java.util.HashMap;
8+
import java.util.Map;
99

1010
public class Decompilers {
11-
static final List<Decompiler> BY_NAME = new ArrayList<>();
11+
static final Map<String, Decompiler> BY_NAME = new HashMap<>();
1212

1313
public final static Decompiler PROCYON = new ProcyonDecompiler();
1414
public final static Decompiler CFR = new CFRDecompiler();
@@ -17,6 +17,6 @@ public class Decompilers {
1717

1818

1919
public static Collection<Decompiler> getAllDecompilers() {
20-
return Collections.unmodifiableCollection(BY_NAME);
20+
return Collections.unmodifiableCollection(BY_NAME.values());
2121
}
2222
}

0 commit comments

Comments
 (0)