diff options
author | Jonas Herzig <jonas@spark-squared.com> | 2021-11-10 13:11:28 +0100 |
---|---|---|
committer | Jonas Herzig <jonas@spark-squared.com> | 2021-11-10 18:11:16 +0100 |
commit | 1b12b4c25a10978a83713e28748a12a41d7591b8 (patch) | |
tree | e8dbe5ebdb38baf0620b50cbb95dfbfc79d74643 /src/main | |
parent | 7d62cd890cb44945e772e18cdb457b1173f4f853 (diff) | |
download | Remap-1b12b4c25a10978a83713e28748a12a41d7591b8.tar.gz Remap-1b12b4c25a10978a83713e28748a12a41d7591b8.tar.bz2 Remap-1b12b4c25a10978a83713e28748a12a41d7591b8.zip |
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.
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/kotlin/com/replaymod/gradle/remap/legacy/LegacyMappingSetModelFactory.kt | 5 |
1 files changed, 2 insertions, 3 deletions
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<MethodMapping> { 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 |