aboutsummaryrefslogtreecommitdiff
path: root/src/test/kotlin/com/replaymod/gradle/remap/mapper
diff options
context:
space:
mode:
authorJonas Herzig <jonas@spark-squared.com>2021-11-10 18:21:25 +0100
committerJonas Herzig <jonas@spark-squared.com>2021-11-10 20:32:40 +0100
commit6883c516e73f55062f27a5f98e306149896c4907 (patch)
treedd1b490c0b2412a4eb1500d0f9274183cb789278 /src/test/kotlin/com/replaymod/gradle/remap/mapper
parent1b12b4c25a10978a83713e28748a12a41d7591b8 (diff)
downloadRemap-6883c516e73f55062f27a5f98e306149896c4907.tar.gz
Remap-6883c516e73f55062f27a5f98e306149896c4907.tar.bz2
Remap-6883c516e73f55062f27a5f98e306149896c4907.zip
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.
Diffstat (limited to 'src/test/kotlin/com/replaymod/gradle/remap/mapper')
-rw-r--r--src/test/kotlin/com/replaymod/gradle/remap/mapper/TestMixinInjections.kt4
1 files changed, 4 insertions, 0 deletions
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()
}