Class EqualsMethod.NullValueGuard.UsingJump

java.lang.Object
net.bytebuddy.implementation.EqualsMethod.NullValueGuard.UsingJump
All Implemented Interfaces:
EqualsMethod.NullValueGuard
Enclosing interface:
EqualsMethod.NullValueGuard

@Enhance public static class EqualsMethod.NullValueGuard.UsingJump extends Object implements EqualsMethod.NullValueGuard
A null value guard that expects a reference type and that skips the comparison if both values are null but returns if the invoked instance's field value is null but not the compared instance's value.
  • Field Details

    • instrumentedMethod

      private final MethodDescription instrumentedMethod
      The instrumented method.
    • firstValueNull

      private final org.objectweb.asm.Label firstValueNull
      The label to jump to if the first value is null whereas the second value is not null.
    • secondValueNull

      private final org.objectweb.asm.Label secondValueNull
      The label to jump to if the second value is null.
    • endOfBlock

      private final org.objectweb.asm.Label endOfBlock
      A label indicating the end of the null-guarding block.
  • Constructor Details

    • UsingJump

      protected UsingJump(MethodDescription instrumentedMethod)
      Creates a new null value guard using a jump instruction for null values.
      Parameters:
      instrumentedMethod - The instrumented method.
  • Method Details

    • before

      public StackManipulation before()
      Returns a stack manipulation to apply before computing equality.
      Specified by:
      before in interface EqualsMethod.NullValueGuard
      Returns:
      A stack manipulation to apply before computing equality.
    • after

      public StackManipulation after()
      Returns a stack manipulation to apply after computing equality.
      Specified by:
      after in interface EqualsMethod.NullValueGuard
      Returns:
      A stack manipulation to apply after computing equality.
    • getRequiredVariablePadding

      public int getRequiredVariablePadding()
      Returns the required padding for the local variable array to apply this guard.
      Specified by:
      getRequiredVariablePadding in interface EqualsMethod.NullValueGuard
      Returns:
      The required padding for the local variable array to apply this guard.