Package net.bytebuddy.implementation
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 java.lang.Object implements EqualsMethod.NullValueGuard
A null value guard that expects a reference type and that skips the comparison if both values arenullbut returns if the invoked instance's field value isnullbut not the compared instance's value.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classEqualsMethod.NullValueGuard.UsingJump.AfterInstructionThe stack manipulation to apply after the equality computation.protected classEqualsMethod.NullValueGuard.UsingJump.BeforeInstructionThe stack manipulation to apply before the equality computation.-
Nested classes/interfaces inherited from interface net.bytebuddy.implementation.EqualsMethod.NullValueGuard
EqualsMethod.NullValueGuard.NoOp, EqualsMethod.NullValueGuard.UsingJump
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.Object[]EMPTYAn empty array.private org.objectweb.asm.LabelendOfBlockA label indicating the end of the null-guarding block.private org.objectweb.asm.LabelfirstValueNullThe label to jump to if the first value isnullwhereas the second value is notnull.private MethodDescriptioninstrumentedMethodThe instrumented method.private static java.lang.Object[]REFERENCEAn array containing a single reference value.private org.objectweb.asm.LabelsecondValueNullThe label to jump to if the second value isnull.
-
Constructor Summary
Constructors Modifier Constructor Description protectedUsingJump(MethodDescription instrumentedMethod)Creates a new null value guard using a jump instruction fornullvalues.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StackManipulationafter()Returns a stack manipulation to apply after computing equality.StackManipulationbefore()Returns a stack manipulation to apply before computing equality.intgetRequiredVariablePadding()Returns the required padding for the local variable array to apply this guard.
-
-
-
Field Detail
-
EMPTY
private static final java.lang.Object[] EMPTY
An empty array.
-
REFERENCE
private static final java.lang.Object[] REFERENCE
An array containing a single reference value.
-
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 isnullwhereas the second value is notnull.
-
secondValueNull
private final org.objectweb.asm.Label secondValueNull
The label to jump to if the second value isnull.
-
endOfBlock
private final org.objectweb.asm.Label endOfBlock
A label indicating the end of the null-guarding block.
-
-
Constructor Detail
-
UsingJump
protected UsingJump(MethodDescription instrumentedMethod)
Creates a new null value guard using a jump instruction fornullvalues.- Parameters:
instrumentedMethod- The instrumented method.
-
-
Method Detail
-
before
public StackManipulation before()
Returns a stack manipulation to apply before computing equality.- Specified by:
beforein interfaceEqualsMethod.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:
afterin interfaceEqualsMethod.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:
getRequiredVariablePaddingin interfaceEqualsMethod.NullValueGuard- Returns:
- The required padding for the local variable array to apply this guard.
-
-