diff options
| author | 2022-09-12 18:28:14 +0100 | |
|---|---|---|
| committer | 2022-09-12 18:28:14 +0100 | |
| commit | bfc47f1b1b501923e16fe89536d7bd52b34149ca (patch) | |
| tree | e5c6cfe9a17c7e2f4d0b2e04bdd21e372d9843bc | |
| parent | Bump fontchooser to 2.5.2 (#456) (diff) | |
| download | enigma-bfc47f1b1b501923e16fe89536d7bd52b34149ca.tar.gz enigma-bfc47f1b1b501923e16fe89536d7bd52b34149ca.tar.xz enigma-bfc47f1b1b501923e16fe89536d7bd52b34149ca.zip | |
Ensure the root method is used when mapping specialized methods (#459)
| -rw-r--r-- | enigma-cli/src/main/java/cuchaz/enigma/command/MapSpecializedMethodsCommand.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/enigma-cli/src/main/java/cuchaz/enigma/command/MapSpecializedMethodsCommand.java b/enigma-cli/src/main/java/cuchaz/enigma/command/MapSpecializedMethodsCommand.java index 94f70100..46da89a2 100644 --- a/enigma-cli/src/main/java/cuchaz/enigma/command/MapSpecializedMethodsCommand.java +++ b/enigma-cli/src/main/java/cuchaz/enigma/command/MapSpecializedMethodsCommand.java | |||
| @@ -1,6 +1,7 @@ | |||
| 1 | package cuchaz.enigma.command; | 1 | package cuchaz.enigma.command; |
| 2 | 2 | ||
| 3 | import cuchaz.enigma.ProgressListener; | 3 | import cuchaz.enigma.ProgressListener; |
| 4 | import cuchaz.enigma.analysis.IndexTreeBuilder; | ||
| 4 | import cuchaz.enigma.analysis.index.BridgeMethodIndex; | 5 | import cuchaz.enigma.analysis.index.BridgeMethodIndex; |
| 5 | import cuchaz.enigma.analysis.index.JarIndex; | 6 | import cuchaz.enigma.analysis.index.JarIndex; |
| 6 | import cuchaz.enigma.classprovider.CachingClassProvider; | 7 | import cuchaz.enigma.classprovider.CachingClassProvider; |
| @@ -53,6 +54,7 @@ public class MapSpecializedMethodsCommand extends Command { | |||
| 53 | 54 | ||
| 54 | BridgeMethodIndex bridgeMethodIndex = jarIndex.getBridgeMethodIndex(); | 55 | BridgeMethodIndex bridgeMethodIndex = jarIndex.getBridgeMethodIndex(); |
| 55 | Translator translator = new MappingTranslator(source, jarIndex.getEntryResolver()); | 56 | Translator translator = new MappingTranslator(source, jarIndex.getEntryResolver()); |
| 57 | IndexTreeBuilder indexTreeBuilder = new IndexTreeBuilder(jarIndex); | ||
| 56 | 58 | ||
| 57 | // Copy all non-specialized methods | 59 | // Copy all non-specialized methods |
| 58 | for (EntryTreeNode<EntryMapping> node : source) { | 60 | for (EntryTreeNode<EntryMapping> node : source) { |
| @@ -64,7 +66,7 @@ public class MapSpecializedMethodsCommand extends Command { | |||
| 64 | // Add correct mappings for specialized methods | 66 | // Add correct mappings for specialized methods |
| 65 | for (Map.Entry<MethodEntry, MethodEntry> entry : bridgeMethodIndex.getBridgeToSpecialized().entrySet()) { | 67 | for (Map.Entry<MethodEntry, MethodEntry> entry : bridgeMethodIndex.getBridgeToSpecialized().entrySet()) { |
| 66 | MethodEntry bridge = entry.getKey(); | 68 | MethodEntry bridge = entry.getKey(); |
| 67 | MethodEntry specialized = entry.getValue(); | 69 | MethodEntry specialized = indexTreeBuilder.buildMethodInheritance(translator, entry.getValue()).getMethodEntry(); |
| 68 | String name = translator.translate(bridge).getName(); | 70 | String name = translator.translate(bridge).getName(); |
| 69 | result.insert(specialized, new EntryMapping(name)); | 71 | result.insert(specialized, new EntryMapping(name)); |
| 70 | } | 72 | } |