diff --git a/src/main/kotlin/com/replaymod/gradle/remap/PsiUtils.kt b/src/main/kotlin/com/replaymod/gradle/remap/PsiUtils.kt index 3b1d692..4941236 100644 --- a/src/main/kotlin/com/replaymod/gradle/remap/PsiUtils.kt +++ b/src/main/kotlin/com/replaymod/gradle/remap/PsiUtils.kt @@ -84,7 +84,7 @@ fun PsiJavaCodeReferenceElement.smartMultiResolve(): PsiElement? { return null // Only do heuristic search on methods } val nonSynthetic = methods.filter { - !it.modifierList.hasModifierProperty("volatile") // ACC_VOLATILE is access 0x40, which is what ACC_BRIDGE is on methods + !it.modifierList.hasModifierProperty(PsiModifier.STRICTFP) } if (nonSynthetic.size == 1) { return nonSynthetic[0] diff --git a/src/main/kotlin/com/replaymod/gradle/remap/classpath/transformers.kt b/src/main/kotlin/com/replaymod/gradle/remap/classpath/transformers.kt index 29e94e2..17b9fd8 100644 --- a/src/main/kotlin/com/replaymod/gradle/remap/classpath/transformers.kt +++ b/src/main/kotlin/com/replaymod/gradle/remap/classpath/transformers.kt @@ -33,8 +33,13 @@ val desynthesizeTransformer = ClasspathTransformer { parent -> signature: String?, exceptions: Array? ): MethodVisitor { - // Remap synthetic to some other meaningless access. All methods that are already bridge should also already be synthetic. - val newAccess = desynthesize(access) or if ((access and Opcodes.ACC_SYNTHETIC) != 0) Opcodes.ACC_BRIDGE else 0 + var newAccess = desynthesize(access) + // We store the synthetic flag as strictfp so that smartMultiResolve can detect if a method was initially synthetic + newAccess = if ((access and Opcodes.ACC_SYNTHETIC) != 0) { + newAccess or Opcodes.ACC_STRICT + } else { + newAccess and Opcodes.ACC_STRICT.inv() + } return object : MethodVisitor(api, super.visitMethod(newAccess, name, descriptor, signature, exceptions)) { override fun visitParameter(name: String?, access: Int) = super.visitParameter(name, desynthesize(access))