diff options
| author | 2016-08-18 12:18:15 +0200 | |
|---|---|---|
| committer | 2016-08-18 12:18:15 +0200 | |
| commit | 7d6f50641e254a24aeb859d7dde8bf314490ca02 (patch) | |
| tree | fca28ed02d64c2e1173c2f1471ddb010b85b88a8 /src | |
| parent | Deploy shadow jar and lib jar to maven (diff) | |
| download | enigma-7d6f50641e254a24aeb859d7dde8bf314490ca02.tar.gz enigma-7d6f50641e254a24aeb859d7dde8bf314490ca02.tar.xz enigma-7d6f50641e254a24aeb859d7dde8bf314490ca02.zip | |
fix #4 by adding bridge checks to related method implementation scanning - please verify
Diffstat (limited to 'src')
| -rw-r--r-- | src/main/java/cuchaz/enigma/analysis/JarIndex.java | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/main/java/cuchaz/enigma/analysis/JarIndex.java b/src/main/java/cuchaz/enigma/analysis/JarIndex.java index bb36c9ea..ddfdbd69 100644 --- a/src/main/java/cuchaz/enigma/analysis/JarIndex.java +++ b/src/main/java/cuchaz/enigma/analysis/JarIndex.java | |||
| @@ -628,7 +628,7 @@ public class JarIndex { | |||
| 628 | 628 | ||
| 629 | public Set<MethodEntry> getRelatedMethodImplementations(MethodEntry obfMethodEntry) { | 629 | public Set<MethodEntry> getRelatedMethodImplementations(MethodEntry obfMethodEntry) { |
| 630 | Set<MethodEntry> methodEntries = Sets.newHashSet(); | 630 | Set<MethodEntry> methodEntries = Sets.newHashSet(); |
| 631 | getRelatedMethodImplementations(methodEntries, getMethodInheritance(null, obfMethodEntry)); | 631 | getRelatedMethodImplementations(methodEntries, getMethodInheritance(new Translator(), obfMethodEntry)); |
| 632 | return methodEntries; | 632 | return methodEntries; |
| 633 | } | 633 | } |
| 634 | 634 | ||
| @@ -639,8 +639,16 @@ public class JarIndex { | |||
| 639 | methodEntries.add(methodEntry); | 639 | methodEntries.add(methodEntry); |
| 640 | } | 640 | } |
| 641 | 641 | ||
| 642 | // look at bridged methods! | ||
| 643 | // FIXME: looks like a hack to me | ||
| 644 | MethodEntry bridgedEntry = getBridgedMethod(methodEntry); | ||
| 645 | while (bridgedEntry != null) { | ||
| 646 | methodEntries.addAll(getRelatedMethodImplementations(bridgedEntry)); | ||
| 647 | bridgedEntry = getBridgedMethod(bridgedEntry); | ||
| 648 | } | ||
| 649 | |||
| 642 | // look at interface methods too | 650 | // look at interface methods too |
| 643 | for (MethodImplementationsTreeNode implementationsNode : getMethodImplementations(null, methodEntry)) { | 651 | for (MethodImplementationsTreeNode implementationsNode : getMethodImplementations(new Translator(), methodEntry)) { |
| 644 | getRelatedMethodImplementations(methodEntries, implementationsNode); | 652 | getRelatedMethodImplementations(methodEntries, implementationsNode); |
| 645 | } | 653 | } |
| 646 | 654 | ||
| @@ -720,7 +728,6 @@ public class JarIndex { | |||
| 720 | } | 728 | } |
| 721 | 729 | ||
| 722 | public Set<String> getImplementingClasses(String targetInterfaceName) { | 730 | public Set<String> getImplementingClasses(String targetInterfaceName) { |
| 723 | |||
| 724 | // linear search is fast enough for now | 731 | // linear search is fast enough for now |
| 725 | Set<String> classNames = Sets.newHashSet(); | 732 | Set<String> classNames = Sets.newHashSet(); |
| 726 | for (Map.Entry<ClassEntry, ClassEntry> entry : this.translationIndex.getClassInterfaces()) { | 733 | for (Map.Entry<ClassEntry, ClassEntry> entry : this.translationIndex.getClassInterfaces()) { |