The spec for Object.hashCode says in part,
(The hashCode may or may not be implemented as some function
of an object's memory address at some point in time.)
In the early days of Java it might have been the case that the default hashCode was based on the address, but this hasn't been true for quite some time. It's misleading to mention the object's address here, and this continues to cause confusion.
This statement should simply be removed.
(The hashCode may or may not be implemented as some function
of an object's memory address at some point in time.)
In the early days of Java it might have been the case that the default hashCode was based on the address, but this hasn't been true for quite some time. It's misleading to mention the object's address here, and this continues to cause confusion.
This statement should simply be removed.
- csr for
-
JDK-8215025 Object.hashCode should not mention anything about memory addresses
- Closed