Annotation Type Advice.AssignReturned.ToThrown

Enclosing class:
Advice.AssignReturned

@Documented @Retention(RUNTIME) @Target(METHOD) public static @interface Advice.AssignReturned.ToThrown

Assigns the advice method's return value as the instrumented method's thrown exception. This annotation can only be used with exit advice marked with Advice.OnMethodExit. Note that a null value on a scalar assignment deactivates this handler and does not, by default, remove a thrown exception. To avoid this, an array assignment must be used or Advice.AssignReturned.AsScalar.skipOnDefaultValue() must be set to false.

Important: This annotation has no effect unless an Advice.AssignReturned post processor is explicitly registered.

  • Element Details

    • index

      int index
      The index in the array that is returned which represents the assigned value. If negative, a scalar return value is expected.
      Returns:
      The index in the array that is returned which represents the assigned value.
      Default:
      -1
    • typing

      The typing to apply when assigning the returned value to the targeted value.
      Returns:
      The typing to apply when assigning the returned value to the targeted value.
      Default:
      STATIC