From bfc47f1b1b501923e16fe89536d7bd52b34149ca Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Mon, 12 Sep 2022 18:28:14 +0100 Subject: Ensure the root method is used when mapping specialized methods (#459) --- .../main/java/cuchaz/enigma/command/MapSpecializedMethodsCommand.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'enigma-cli') 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 94f7010..46da89a 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 @@ package cuchaz.enigma.command; import cuchaz.enigma.ProgressListener; +import cuchaz.enigma.analysis.IndexTreeBuilder; import cuchaz.enigma.analysis.index.BridgeMethodIndex; import cuchaz.enigma.analysis.index.JarIndex; import cuchaz.enigma.classprovider.CachingClassProvider; @@ -53,6 +54,7 @@ public class MapSpecializedMethodsCommand extends Command { BridgeMethodIndex bridgeMethodIndex = jarIndex.getBridgeMethodIndex(); Translator translator = new MappingTranslator(source, jarIndex.getEntryResolver()); + IndexTreeBuilder indexTreeBuilder = new IndexTreeBuilder(jarIndex); // Copy all non-specialized methods for (EntryTreeNode node : source) { @@ -64,7 +66,7 @@ public class MapSpecializedMethodsCommand extends Command { // Add correct mappings for specialized methods for (Map.Entry entry : bridgeMethodIndex.getBridgeToSpecialized().entrySet()) { MethodEntry bridge = entry.getKey(); - MethodEntry specialized = entry.getValue(); + MethodEntry specialized = indexTreeBuilder.buildMethodInheritance(translator, entry.getValue()).getMethodEntry(); String name = translator.translate(bridge).getName(); result.insert(specialized, new EntryMapping(name)); } -- cgit v1.2.3