fix: clear method lookup maps before initializing them (#210)

Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
This commit is contained in:
aAbed 2023-08-03 17:27:00 +05:45 committed by GitHub
parent c65c3df11c
commit 746544f9d5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -392,4 +392,4 @@ class Patcher(private val options: PatcherOptions) {
* @param patchInstance The instance of the [Patch] that was applied.
* @param success The result of the [Patch].
*/
internal data class ExecutedPatch(val patchInstance: Patch<Context>, val success: Boolean)
internal data class ExecutedPatch(val patchInstance: Patch<Context>, val success: Boolean)

View file

@ -99,7 +99,7 @@ abstract class MethodFingerprint(
methodClassPairs!!.add(methodClassPair)
}
if (methods.isNotEmpty()) throw PatchResultError("Map already initialized")
if (methods.isNotEmpty()) MethodFingerprint.clearFingerprintResolutionLookupMaps()
context.classes.classes.forEach { classDef ->
classDef.methods.forEach { method ->
@ -510,4 +510,4 @@ data class MethodFingerprintResult(
)
}
}
}
}