[BUG] Java 15: DecimalFormatSymbols overrides equals but not hashCode

Brian Burkhalter brian.burkhalter at oracle.com
Tue Sep 15 19:36:10 UTC 2020


Hello,

The override of hashCode() looks like it is still there in JDK 15 [1]. I don’t know however why it does not appear as such in the javadoc [2].

Brian

[1] http://hg.openjdk.java.net/jdk/jdk15/file/fb7064dc63f9/src/java.base/share/classes/java/text/DecimalFormatSymbols.java#l760
[2] https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/text/DecimalFormatSymbols.html

> On Sep 15, 2020, at 12:14 PM, Rob Spoor <openjdk at icemanx.nl> wrote:
> 
> In Java 14 and before, DecimalFormatSymbols had overrides for both equals and hashCode. In Java 15, the override for hashCode has disappeared, and it now inherits hashCode from java.lang.Object. That means it now violates the contract for equals + hashCode: two equal DecimalFormatSymbols instances can have different hash codes.



More information about the core-libs-dev mailing list