diff options
| author | 2016-08-17 16:04:34 +0200 | |
|---|---|---|
| committer | 2016-08-17 16:04:34 +0200 | |
| commit | 381b3f5b739b623f6a32e21f202abf2099173515 (patch) | |
| tree | e271328df602adb442cd73b01f83803a3f74ba85 /src/main/java | |
| parent | fix #2 (diff) | |
| download | enigma-381b3f5b739b623f6a32e21f202abf2099173515.tar.gz enigma-381b3f5b739b623f6a32e21f202abf2099173515.tar.xz enigma-381b3f5b739b623f6a32e21f202abf2099173515.zip | |
better fix for #2
Diffstat (limited to 'src/main/java')
| -rw-r--r-- | src/main/java/cuchaz/enigma/analysis/JarIndex.java | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/main/java/cuchaz/enigma/analysis/JarIndex.java b/src/main/java/cuchaz/enigma/analysis/JarIndex.java index 96f92c3d..51a2543a 100644 --- a/src/main/java/cuchaz/enigma/analysis/JarIndex.java +++ b/src/main/java/cuchaz/enigma/analysis/JarIndex.java | |||
| @@ -704,18 +704,17 @@ 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); | ||
| 711 | for (Map.Entry<ClassEntry, ClassEntry> entry : this.translationIndex.getClassInterfaces()) { | 710 | for (Map.Entry<ClassEntry, ClassEntry> entry : this.translationIndex.getClassInterfaces()) { |
| 712 | ClassEntry classEntry = entry.getKey(); | 711 | ClassEntry classEntry = entry.getKey(); |
| 713 | ClassEntry interfaceEntry = entry.getValue(); | 712 | ClassEntry interfaceEntry = entry.getValue(); |
| 714 | if (interfaceNames.contains(interfaceEntry.getName())) { | 713 | if (interfaceEntry.getName().equals(targetInterfaceName)) { |
| 715 | String className = classEntry.getClassName(); | 714 | String className = classEntry.getClassName(); |
| 716 | classNames.add(className); | 715 | classNames.add(className); |
| 717 | if (isInterface(className)) { | 716 | if (isInterface(className)) { |
| 718 | interfaceNames.add(className); | 717 | classNames.addAll(getImplementingClasses(className)); |
| 719 | } | 718 | } |
| 720 | 719 | ||
| 721 | this.translationIndex.getSubclassNamesRecursively(classNames, classEntry); | 720 | this.translationIndex.getSubclassNamesRecursively(classNames, classEntry); |