PatchInterceptAdvice

Head-side decision: rewrite arguments, or skip the body and return a substitute.

Both ends are woven, but only enter calls the bridge — skipOn is just a jump, and ByteBuddy forbids writing the return value from enter advice, so exit exists only to move the decision into the return slot. The callback still fires once, at the head.

See also

for the return-side decision

Constructors

Link copied to clipboard
private constructor()

Functions

Link copied to clipboard
@Advice.OnMethodEnter(skipOn = OnNonDefaultValue::class, suppress = Throwable::class)
open fun enter(slot: Int, key: String, @Advice.Origin sig: MethodType, @Advice.This(optional = true) self: Any, @Advice.AllArguments(readOnly = false, typing = Assigner.Typing.DYNAMIC) args: Array<Any>): Any
Read once into a local, hand that to the bridge, store it back — none of which is decoration.
Link copied to clipboard
@Advice.OnMethodExit(suppress = Throwable::class)
@Advice.AssignReturned.AsScalar
@Advice.AssignReturned.ToReturned(typing = Assigner.Typing.DYNAMIC)
open fun exit(@Advice.Enter carrier: Any): Any
No bridge call, no allocation.