Prevent Error-Prone `NumericEquality` warning
In triggering `NumericEquality`
warnings is prevented for optional numbers. This change tackles non-optional
`java.lang.Number` instances.
This relates to
@@ -2864,7 +2864,7 @@ public final [type.typeImmutable.relative] [v.names.with]([v.atNullability][if v
* A value strict bits equality used to prevent copying of the same value by returning {@code this}.
[else if v.primitive]
* A value equality check is used to prevent copying of the same value by returning {@code this}.
- [else if v.primitiveWrapperType or v.stringType]
+ [else if v.hasSimpleScalarElementType or v.isSuppressedOptional]
* An equals check used to prevent copying of the same value by returning {@code this}.
[else]
* A shallow reference equality check is used to prevent copying of the same value by returning {@code this}.
@@ -2878,7 +2878,9 @@ public final [type.typeImmutable.relative] [v.names.with]([v.atNullability][v.ty
if (Float.floatToIntBits(this.[v.name]) == Float.floatToIntBits(value)) return this;
[else if v.double]
if (Double.doubleToLongBits(this.[v.name]) == Double.doubleToLongBits(value)) return this;
- [else if v.stringType or (v.primitiveWrapperType or v.isSuppressedOptional)]
+ [else if v.primitive]
+ if (this.[v.name] == value) return this;
+ [else if v.hasSimpleScalarElementType or v.isSuppressedOptional]
[if v.nullable]
if ([objectsEqual type](this.[v.name], value)) return this;
[else]
