mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8199394: Object.hashCode should not mention anything about memory addresses
Reviewed-by: shade, forax, adinn, rriggs
This commit is contained in:
parent
019bd7cf2b
commit
7cea6f6ac2
1 changed files with 4 additions and 6 deletions
|
@ -94,12 +94,10 @@ public class Object {
|
||||||
* programmer should be aware that producing distinct integer results
|
* programmer should be aware that producing distinct integer results
|
||||||
* for unequal objects may improve the performance of hash tables.
|
* for unequal objects may improve the performance of hash tables.
|
||||||
* </ul>
|
* </ul>
|
||||||
* <p>
|
*
|
||||||
* As much as is reasonably practical, the hashCode method defined
|
* @implSpec
|
||||||
* by class {@code Object} does return distinct integers for
|
* As far as is reasonably practical, the {@code hashCode} method defined
|
||||||
* distinct objects. (The hashCode may or may not be implemented
|
* by class {@code Object} returns distinct integers for distinct objects.
|
||||||
* as some function of an object's memory address at some point
|
|
||||||
* in time.)
|
|
||||||
*
|
*
|
||||||
* @return a hash code value for this object.
|
* @return a hash code value for this object.
|
||||||
* @see java.lang.Object#equals(java.lang.Object)
|
* @see java.lang.Object#equals(java.lang.Object)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue