injectReplace

fun injectReplace(targetClassName: String, methodName: String, parameterTypeNames: List<String> = emptyList(), owner: String? = null, handler: (UnsafeInvocationContext) -> Any?): UnsafeHandle

Replaces entire target method body (string-based overload).

The handler return value becomes the method return value.


fun injectReplace(method: Method, owner: String? = null, handler: (UnsafeInvocationContext) -> Any?): UnsafeHandle

Replaces entire target method body (Method overload).