diff options
Diffstat (limited to 'src/cuchaz/enigma/analysis')
| -rw-r--r-- | src/cuchaz/enigma/analysis/BridgeMarker.java | 11 | ||||
| -rw-r--r-- | src/cuchaz/enigma/analysis/JarIndex.java | 10 |
2 files changed, 8 insertions, 13 deletions
diff --git a/src/cuchaz/enigma/analysis/BridgeMarker.java b/src/cuchaz/enigma/analysis/BridgeMarker.java index e80f87d..28e3517 100644 --- a/src/cuchaz/enigma/analysis/BridgeMarker.java +++ b/src/cuchaz/enigma/analysis/BridgeMarker.java | |||
| @@ -3,18 +3,15 @@ package cuchaz.enigma.analysis; | |||
| 3 | import javassist.CtClass; | 3 | import javassist.CtClass; |
| 4 | import javassist.CtMethod; | 4 | import javassist.CtMethod; |
| 5 | import javassist.bytecode.AccessFlag; | 5 | import javassist.bytecode.AccessFlag; |
| 6 | |||
| 7 | import com.google.common.collect.BiMap; | ||
| 8 | |||
| 9 | import cuchaz.enigma.mapping.EntryFactory; | 6 | import cuchaz.enigma.mapping.EntryFactory; |
| 10 | import cuchaz.enigma.mapping.MethodEntry; | 7 | import cuchaz.enigma.mapping.MethodEntry; |
| 11 | 8 | ||
| 12 | public class BridgeMarker { | 9 | public class BridgeMarker { |
| 13 | 10 | ||
| 14 | private BiMap<MethodEntry,MethodEntry> m_bridgedMethods; | 11 | private JarIndex m_jarIndex; |
| 15 | 12 | ||
| 16 | public BridgeMarker(BiMap<MethodEntry,MethodEntry> bridgedMethods) { | 13 | public BridgeMarker(JarIndex jarIndex) { |
| 17 | m_bridgedMethods = bridgedMethods; | 14 | m_jarIndex = jarIndex; |
| 18 | } | 15 | } |
| 19 | 16 | ||
| 20 | public void markBridges(CtClass c) { | 17 | public void markBridges(CtClass c) { |
| @@ -23,7 +20,7 @@ public class BridgeMarker { | |||
| 23 | MethodEntry methodEntry = EntryFactory.getMethodEntry(method); | 20 | MethodEntry methodEntry = EntryFactory.getMethodEntry(method); |
| 24 | 21 | ||
| 25 | // is this a bridge method? | 22 | // is this a bridge method? |
| 26 | MethodEntry bridgedMethodEntry = m_bridgedMethods.get(methodEntry); | 23 | MethodEntry bridgedMethodEntry = m_jarIndex.getBridgedMethod(methodEntry); |
| 27 | if (bridgedMethodEntry != null) { | 24 | if (bridgedMethodEntry != null) { |
| 28 | 25 | ||
| 29 | // it's a bridge method! add the bridge flag | 26 | // it's a bridge method! add the bridge flag |
diff --git a/src/cuchaz/enigma/analysis/JarIndex.java b/src/cuchaz/enigma/analysis/JarIndex.java index 797deb8..1c74f15 100644 --- a/src/cuchaz/enigma/analysis/JarIndex.java +++ b/src/cuchaz/enigma/analysis/JarIndex.java | |||
| @@ -34,8 +34,6 @@ import javassist.expr.FieldAccess; | |||
| 34 | import javassist.expr.MethodCall; | 34 | import javassist.expr.MethodCall; |
| 35 | import javassist.expr.NewExpr; | 35 | import javassist.expr.NewExpr; |
| 36 | 36 | ||
| 37 | import com.google.common.collect.BiMap; | ||
| 38 | import com.google.common.collect.HashBiMap; | ||
| 39 | import com.google.common.collect.HashMultimap; | 37 | import com.google.common.collect.HashMultimap; |
| 40 | import com.google.common.collect.Lists; | 38 | import com.google.common.collect.Lists; |
| 41 | import com.google.common.collect.Maps; | 39 | import com.google.common.collect.Maps; |
| @@ -66,7 +64,7 @@ public class JarIndex { | |||
| 66 | private Multimap<String,String> m_innerClasses; | 64 | private Multimap<String,String> m_innerClasses; |
| 67 | private Map<String,String> m_outerClasses; | 65 | private Map<String,String> m_outerClasses; |
| 68 | private Map<String,BehaviorEntry> m_anonymousClasses; | 66 | private Map<String,BehaviorEntry> m_anonymousClasses; |
| 69 | private BiMap<MethodEntry,MethodEntry> m_bridgedMethods; | 67 | private Map<MethodEntry,MethodEntry> m_bridgedMethods; |
| 70 | 68 | ||
| 71 | public JarIndex() { | 69 | public JarIndex() { |
| 72 | m_obfClassEntries = Sets.newHashSet(); | 70 | m_obfClassEntries = Sets.newHashSet(); |
| @@ -79,7 +77,7 @@ public class JarIndex { | |||
| 79 | m_innerClasses = HashMultimap.create(); | 77 | m_innerClasses = HashMultimap.create(); |
| 80 | m_outerClasses = Maps.newHashMap(); | 78 | m_outerClasses = Maps.newHashMap(); |
| 81 | m_anonymousClasses = Maps.newHashMap(); | 79 | m_anonymousClasses = Maps.newHashMap(); |
| 82 | m_bridgedMethods = HashBiMap.create(); | 80 | m_bridgedMethods = Maps.newHashMap(); |
| 83 | } | 81 | } |
| 84 | 82 | ||
| 85 | public void indexJar(JarFile jar, boolean buildInnerClasses) { | 83 | public void indexJar(JarFile jar, boolean buildInnerClasses) { |
| @@ -758,7 +756,7 @@ public class JarIndex { | |||
| 758 | } | 756 | } |
| 759 | } | 757 | } |
| 760 | 758 | ||
| 761 | public BiMap<MethodEntry,MethodEntry> getBridgedMethods() { | 759 | public MethodEntry getBridgedMethod(MethodEntry bridgeMethodEntry) { |
| 762 | return m_bridgedMethods; | 760 | return m_bridgedMethods.get(bridgeMethodEntry); |
| 763 | } | 761 | } |
| 764 | } | 762 | } |