Class BeforeFinalReturn


  • public class BeforeFinalReturn
    extends InjectionPoint

    This injection point searches for the last RETURN opcode in the target method and returns it. Note that the last RETURN opcode may not correspond to the notional "bottom" of a method in the original Java source, since conditional expressions can cause the bytecode emitted to differ significantly in order from the original Java.

    Example:

       @At(value = "TAIL")

    Note that if value is the only parameter specified, it can be omitted:

       @At("TAIL")
    • Method Detail

      • checkPriority

        public boolean checkPriority​(int targetPriority,
                                     int ownerPriority)
        Description copied from class: InjectionPoint
        Runs a priority check in the context of this injection point. A priority check should return true if the injection point is allowed to inject given the relative priorities of the target (a method merged by another mixin with targetPriority) and the incoming mixin with priority mixinPriority.
        Overrides:
        checkPriority in class InjectionPoint
        Parameters:
        targetPriority - Priority of the mixin which originally merged the target method in question
        ownerPriority - Priority of the mixin which owns the owning injector
        Returns:
        true if the priority check succeeds
      • find

        public boolean find​(java.lang.String desc,
                            org.objectweb.asm.tree.InsnList insns,
                            java.util.Collection<org.objectweb.asm.tree.AbstractInsnNode> nodes)
        Description copied from class: InjectionPoint
        Find injection points in the supplied insn list
        Specified by:
        find in class InjectionPoint
        Parameters:
        desc - Method descriptor, supplied to allow return types and arguments etc. to be determined
        insns - Insn list to search in, the strategy MUST ONLY add nodes from this list to the nodes collection
        nodes - Collection of nodes to populate. Injectors should NOT make any assumptions about the state of this collection and should only call the add() method
        Returns:
        true if one or more injection points were found