summaryrefslogtreecommitdiff
path: root/src/main/java/cuchaz/enigma/analysis
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/cuchaz/enigma/analysis')
-rw-r--r--src/main/java/cuchaz/enigma/analysis/JarIndex.java12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/main/java/cuchaz/enigma/analysis/JarIndex.java b/src/main/java/cuchaz/enigma/analysis/JarIndex.java
index 9acf0b1..96f92c3 100644
--- a/src/main/java/cuchaz/enigma/analysis/JarIndex.java
+++ b/src/main/java/cuchaz/enigma/analysis/JarIndex.java
@@ -704,14 +704,20 @@ public class JarIndex {
704 } 704 }
705 705
706 public Set<String> getImplementingClasses(String targetInterfaceName) { 706 public Set<String> getImplementingClasses(String targetInterfaceName) {
707 707
708 // linear search is fast enough for now 708 // linear search is fast enough for now
709 Set<String> classNames = Sets.newHashSet(); 709 Set<String> classNames = Sets.newHashSet();
710 Set<String> interfaceNames = Sets.newHashSet(targetInterfaceName);
710 for (Map.Entry<ClassEntry, ClassEntry> entry : this.translationIndex.getClassInterfaces()) { 711 for (Map.Entry<ClassEntry, ClassEntry> entry : this.translationIndex.getClassInterfaces()) {
711 ClassEntry classEntry = entry.getKey(); 712 ClassEntry classEntry = entry.getKey();
712 ClassEntry interfaceEntry = entry.getValue(); 713 ClassEntry interfaceEntry = entry.getValue();
713 if (interfaceEntry.getName().equals(targetInterfaceName)) { 714 if (interfaceNames.contains(interfaceEntry.getName())) {
714 classNames.add(classEntry.getClassName()); 715 String className = classEntry.getClassName();
716 classNames.add(className);
717 if (isInterface(className)) {
718 interfaceNames.add(className);
719 }
720
715 this.translationIndex.getSubclassNamesRecursively(classNames, classEntry); 721 this.translationIndex.getSubclassNamesRecursively(classNames, classEntry);
716 } 722 }
717 } 723 }