From 1b12b4c25a10978a83713e28748a12a41d7591b8 Mon Sep 17 00:00:00 2001 From: Jonas Herzig Date: Wed, 10 Nov 2021 13:11:28 +0100 Subject: Fix legacy mapping set stripping descriptor when it should not Because `hasMapping` is broken and returns false even when there is a change in method parameter types. Instead we'll just compare the stringified signature. --- .../replaymod/gradle/remap/legacy/LegacyMappingSetModelFactory.kt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/main') diff --git a/src/main/kotlin/com/replaymod/gradle/remap/legacy/LegacyMappingSetModelFactory.kt b/src/main/kotlin/com/replaymod/gradle/remap/legacy/LegacyMappingSetModelFactory.kt index 7737200..ec21546 100644 --- a/src/main/kotlin/com/replaymod/gradle/remap/legacy/LegacyMappingSetModelFactory.kt +++ b/src/main/kotlin/com/replaymod/gradle/remap/legacy/LegacyMappingSetModelFactory.kt @@ -6,8 +6,7 @@ import org.cadixdev.lorenz.impl.MappingSetModelFactoryImpl import org.cadixdev.lorenz.impl.model.TopLevelClassMappingImpl import org.cadixdev.lorenz.model.MethodMapping import org.cadixdev.lorenz.model.TopLevelClassMapping - -import java.util.Optional +import java.util.* class LegacyMappingSetModelFactory : MappingSetModelFactoryImpl() { override fun createTopLevelClassMapping(parent: MappingSet, obfuscatedName: String, deobfuscatedName: String): TopLevelClassMapping { @@ -23,7 +22,7 @@ class LegacyMappingSetModelFactory : MappingSetModelFactoryImpl() { override fun getMethodMapping(signature: MethodSignature): Optional { var maybeMapping = super.getMethodMapping(signature) - if (!maybeMapping.isPresent || !maybeMapping.get().hasMappings()) { + if (!maybeMapping.isPresent || maybeMapping.get().let { it.signature == it.deobfuscatedSignature }) { maybeMapping = super.getMethodMapping(stripDesc(signature)) } return maybeMapping -- cgit