From 6883c516e73f55062f27a5f98e306149896c4907 Mon Sep 17 00:00:00 2001 From: Jonas Herzig Date: Wed, 10 Nov 2021 18:21:25 +0100 Subject: Fix mixin injectors not considering mappings from parent classes When remapping the injector target argument (`method`), we used to only look at the mappings for the mixin target class but we also need to consider mappings for its super classes and interfaces. This commit now searches for the target Psi method and then uses the regular remap method for PsiMethod to get its properly mapped name. It still only looks at the target class mappings to determine whether the new name is ambiguous because we do not have access to the remapped target class hierarchy. --- .../kotlin/com/replaymod/gradle/remap/mapper/TestMixinInjections.kt | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/test') diff --git a/src/test/kotlin/com/replaymod/gradle/remap/mapper/TestMixinInjections.kt b/src/test/kotlin/com/replaymod/gradle/remap/mapper/TestMixinInjections.kt index 856b56e..7b9750e 100644 --- a/src/test/kotlin/com/replaymod/gradle/remap/mapper/TestMixinInjections.kt +++ b/src/test/kotlin/com/replaymod/gradle/remap/mapper/TestMixinInjections.kt @@ -13,12 +13,16 @@ class TestMixinInjections { class MixinA { @$annotation(method = "aMethod") private void test() {} + @$annotation(method = "aInterfaceMethod") + private void testInterface() {} } """.trimIndent()) shouldBe """ @org.spongepowered.asm.mixin.Mixin(b.pkg.B.class) class MixinA { @$annotation(method = "bMethod") private void test() {} + @$annotation(method = "bInterfaceMethod") + private void testInterface() {} } """.trimIndent() } -- cgit