8199394: Object.hashCode should not mention anything about memory addresses
authorsmarks
Tue, 11 Dec 2018 13:10:14 -0800
changeset 52953 b75a44aad06c
parent 52952 837f1b8442be
child 52954 799e964e32b6
8199394: Object.hashCode should not mention anything about memory addresses Reviewed-by: shade, forax, adinn, rriggs
src/java.base/share/classes/java/lang/Object.java
--- a/src/java.base/share/classes/java/lang/Object.java	Tue Dec 11 12:45:38 2018 -0800
+++ b/src/java.base/share/classes/java/lang/Object.java	Tue Dec 11 13:10:14 2018 -0800
@@ -94,12 +94,10 @@
      *     programmer should be aware that producing distinct integer results
      *     for unequal objects may improve the performance of hash tables.
      * </ul>
-     * <p>
-     * As much as is reasonably practical, the hashCode method defined
-     * by class {@code Object} does return distinct integers for
-     * distinct objects. (The hashCode may or may not be implemented
-     * as some function of an object's memory address at some point
-     * in time.)
+     *
+     * @implSpec
+     * As far as is reasonably practical, the {@code hashCode} method defined
+     * by class {@code Object} returns distinct integers for distinct objects.
      *
      * @return  a hash code value for this object.
      * @see     java.lang.Object#equals(java.lang.Object)