Class RecordMethodsDesugarizer
java.lang.Object
sootup.interceptors.invokedynamic.RecordMethodsDesugarizer
- All Implemented Interfaces:
InvokeDynamicDesugarizer
ObjectMethods.bootstrap - the body of a record's toString, hashCode and
equals - lowered to the code it stands for, component by component (the
REF_GET_FIELD bootstrap arguments):
toString:"R[a=" + a + ", b=" + b + "]".hashCode:h = 31 * h + hash(c)fromh = 0, withObjects.hashCodeor the wrapper's statichashCodeashash.equals:this == o, elseo instanceof Rand each component equal -Objects.equals,Float/Double.compare(a, b) == 0or==- checked last to first, asObjectMethodsdoes.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanapplies(@NonNull JDynamicInvokeExpr expr) Whether this desugarizer handlesexpr.booleandesugar(@NonNull JDynamicInvokeExpr expr, @Nullable LValue result, @NonNull Fragment code) Emits code intocodethat does whatexprdoes and stores its value intoresult.
-
Constructor Details
-
RecordMethodsDesugarizer
public RecordMethodsDesugarizer()
-
-
Method Details
-
applies
Description copied from interface:InvokeDynamicDesugarizerWhether this desugarizer handlesexpr.- Specified by:
appliesin interfaceInvokeDynamicDesugarizer
-
desugar
public boolean desugar(@NonNull JDynamicInvokeExpr expr, @Nullable LValue result, @NonNull Fragment code) Description copied from interface:InvokeDynamicDesugarizerEmits code intocodethat does whatexprdoes and stores its value intoresult.- Specified by:
desugarin interfaceInvokeDynamicDesugarizerresult- where the invokedynamic's value goes,nullif it is discarded- Returns:
- whether
exprcould be lowered; if not, the invokedynamic stays
-