Skip to content
Permalink
Browse files
8262927: Explicitly state fields examined for BigDecimal.hashCode
Reviewed-by: bpb
  • Loading branch information
jddarcy committed Mar 3, 2021
1 parent b397472 commit 28489389775fefd1d733b1ddf98cc9ef94ee0f00
Showing with 7 additions and 2 deletions.
  1. +7 −2 src/java.base/share/classes/java/math/BigDecimal.java
@@ -3215,8 +3215,13 @@ public BigDecimal max(BigDecimal val) {
// Hash Function

/**
* Returns the hash code for this {@code BigDecimal}. Note that
* two {@code BigDecimal} objects that are numerically equal but
* Returns the hash code for this {@code BigDecimal}.
* The hash code is computed as a function of the {@linkplain
* unscaledValue() unscaled value} and the {@linkplain scale()
* scale} of this {@code BigDecimal}.
*
* @apiNote
* Two {@code BigDecimal} objects that are numerically equal but
* differ in scale (like 2.0 and 2.00) will generally <em>not</em>
* have the same hash code.
*

1 comment on commit 2848938

@openjdk-notifier

This comment has been minimized.

Copy link

@openjdk-notifier openjdk-notifier bot commented on 2848938 Mar 3, 2021

Please sign in to comment.