diff options
| author | 2016-08-17 15:49:26 +0200 | |
|---|---|---|
| committer | 2016-08-17 15:49:26 +0200 | |
| commit | 37e8806d0b00128a25b4aa6a8058f68d63e34a91 (patch) | |
| tree | b6fed45b6c125fa8f482b1ec47c65c1429644372 | |
| parent | update group id (diff) | |
| download | enigma-37e8806d0b00128a25b4aa6a8058f68d63e34a91.tar.gz enigma-37e8806d0b00128a25b4aa6a8058f68d63e34a91.tar.xz enigma-37e8806d0b00128a25b4aa6a8058f68d63e34a91.zip | |
fix #2
| -rw-r--r-- | src/main/java/cuchaz/enigma/analysis/JarIndex.java | 12 |
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 9acf0b14..96f92c3d 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 | } |