RFR: 8262927: Explicitly state fields examined for BigDecimal.hashCode

Brian Burkhalter bpb at openjdk.java.net
Wed Mar 3 23:05:41 UTC 2021


On Wed, 3 Mar 2021 22:20:45 GMT, Joe Darcy <darcy at openjdk.org> wrote:

> The class BigDecimal can be and sometimes is subclassed. The spec of BigDecimal.hashCode is improved slightly by explicitly stating it is a function of the unscaled value and the scale of the BigDecimal, the same fields examined by equals.
> 
> It is a conscious choice to *not* explicitly state what the exact hash function is.
> 
> As the behavior of hashCode is mostly implied from equals, I don't think a CSR is necessary in this case.

Looks fine.

-------------

Marked as reviewed by bpb (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/2817


More information about the core-libs-dev mailing list