diff options
| -rw-r--r-- | src/main/java/cuchaz/enigma/analysis/MethodInheritanceTreeNode.java | 5 | ||||
| -rw-r--r-- | src/main/java/cuchaz/enigma/analysis/TranslationIndex.java | 11 |
2 files changed, 16 insertions, 0 deletions
diff --git a/src/main/java/cuchaz/enigma/analysis/MethodInheritanceTreeNode.java b/src/main/java/cuchaz/enigma/analysis/MethodInheritanceTreeNode.java index 904e5945..dc341979 100644 --- a/src/main/java/cuchaz/enigma/analysis/MethodInheritanceTreeNode.java +++ b/src/main/java/cuchaz/enigma/analysis/MethodInheritanceTreeNode.java | |||
| @@ -89,6 +89,11 @@ public class MethodInheritanceTreeNode extends DefaultMutableTreeNode { | |||
| 89 | nodes.add(new MethodInheritanceTreeNode(this.deobfuscatingTranslator, methodEntry, index.containsObfMethod(methodEntry))); | 89 | nodes.add(new MethodInheritanceTreeNode(this.deobfuscatingTranslator, methodEntry, index.containsObfMethod(methodEntry))); |
| 90 | } | 90 | } |
| 91 | 91 | ||
| 92 | for (ClassEntry subclassEntry : index.getTranslationIndex().getImplementers(this.entry.getOwnerClassEntry())) { | ||
| 93 | MethodEntry methodEntry = new MethodEntry(subclassEntry, this.entry.getName(), this.entry.getDesc()); | ||
| 94 | nodes.add(new MethodInheritanceTreeNode(this.deobfuscatingTranslator, methodEntry, index.containsObfMethod(methodEntry))); | ||
| 95 | } | ||
| 96 | |||
| 92 | // add them to this node | 97 | // add them to this node |
| 93 | nodes.forEach(this::add); | 98 | nodes.forEach(this::add); |
| 94 | 99 | ||
diff --git a/src/main/java/cuchaz/enigma/analysis/TranslationIndex.java b/src/main/java/cuchaz/enigma/analysis/TranslationIndex.java index db116623..984d84b2 100644 --- a/src/main/java/cuchaz/enigma/analysis/TranslationIndex.java +++ b/src/main/java/cuchaz/enigma/analysis/TranslationIndex.java | |||
| @@ -155,6 +155,17 @@ public class TranslationIndex { | |||
| 155 | return ancestors; | 155 | return ancestors; |
| 156 | } | 156 | } |
| 157 | 157 | ||
| 158 | public List<ClassEntry> getImplementers(ClassEntry classEntry) { | ||
| 159 | // linear search is fast enough for now | ||
| 160 | List<ClassEntry> implementers = Lists.newArrayList(); | ||
| 161 | for (ClassEntry itf : this.interfaces.keySet()) { | ||
| 162 | if (this.interfaces.containsEntry(itf, classEntry)) { | ||
| 163 | implementers.add(itf); | ||
| 164 | } | ||
| 165 | } | ||
| 166 | return implementers; | ||
| 167 | } | ||
| 168 | |||
| 158 | public List<ClassEntry> getSubclass(ClassEntry classEntry) { | 169 | public List<ClassEntry> getSubclass(ClassEntry classEntry) { |
| 159 | // linear search is fast enough for now | 170 | // linear search is fast enough for now |
| 160 | List<ClassEntry> subclasses = Lists.newArrayList(); | 171 | List<ClassEntry> subclasses = Lists.newArrayList(); |