PatchModifyAdvice

Return-side decision: replace the return value. Only the exit end is woven.

skipOnDefaultValue = false, the opposite of PatchInterceptAdvice: the body ran, so the slot holds a real value and "returned null" cannot mean "leave it alone" without making replacement-with-null unexpressible. The bridge hands returned back instead, and every exit pays one assignment.

Advice.Thrown is read-only: a throwing method still throws, and the substitute is discarded.

See also

for the head-side decision

Constructors

Link copied to clipboard
private constructor()

Functions

Link copied to clipboard
@Advice.OnMethodExit(onThrowable = Throwable::class, suppress = Throwable::class)
@Advice.AssignReturned.AsScalar(skipOnDefaultValue = false)
@Advice.AssignReturned.ToReturned(typing = Assigner.Typing.DYNAMIC)
open fun exit(slot: Int, key: String, @Advice.Origin sig: MethodType, @Advice.This(optional = true) self: Any, @Advice.AllArguments args: Array<Any>, @Advice.Return(typing = Assigner.Typing.DYNAMIC) returned: Any, @Advice.Thrown thrown: Throwable): Any
The inlined @OnMethodExit body: hand the exit to fireModify and let the post-processor assign whatever comes back.