make navigator stop method mutable

This commit is contained in:
oSumAtrIX
2026-01-30 16:24:25 +01:00
parent 577dae61db
commit f96cf2c416

View File

@@ -92,7 +92,8 @@ class MethodNavigator internal constructor(
*/
context(context: BytecodePatchContext)
fun stop() =
context.classDefs[lastNavigatedMethodReference.definingClass]!!
context.classDefs
.getOrReplaceMutable(context.classDefs[lastNavigatedMethodReference.definingClass]!!)
.firstMethodBySignature as MutableMethod
/**
@@ -117,10 +118,7 @@ class MethodNavigator internal constructor(
* Find the first [lastNavigatedMethodReference] in the class.
*/
private val ClassDef.firstMethodBySignature
get() =
methods.first {
MethodUtil.methodSignaturesMatch(it, lastNavigatedMethodReference)
}
get() = methods.first { MethodUtil.methodSignaturesMatch(it, lastNavigatedMethodReference) }
/**
* An exception thrown when navigating fails.