JDK-8071434 : doc updates for java.lang.Object
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.lang
  • Affected Version: 8u31
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: solaris_11
  • CPU: x86
  • Submitted: 2015-01-21
  • Updated: 2022-05-13
  • Resolved: 2015-01-29
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9 b49Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Description
A DESCRIPTION OF THE PROBLEM :
The documentation includes the sentence

	(This is typically implemented by converting the internal address of
	the object into an integer, but this implementation technique is not
	required by the Java™ programming language.)

I don't think any of our Java implementations has returned the internal address of an object since we started having exact garbage collectors that moved objects.  (JDK-1.2?)  The address of an object may change if the collector moves the object; and if the collector moves the object, some other object may appear at the original address when it comes time to assign that object a System.identityHashCode().

I am pretty sure that the way System.identityHashCode() is implemented is by calling Object.hashCode(), (rather than any override?) if that has not been done before, and storing the result in some number of bits in the header of the object.  I don't know if we want to document that behavior either.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
-- Nothing --
ACTUAL -
(This is typically implemented by converting the internal address of
the object into an integer, but this implementation technique is not
required by the Java™ programming language.)

URL OF FAULTY DOCUMENTATION :
http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--


Comments
URL: http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/458adf31ad5b User: lana Date: 2015-02-04 21:53:46 +0000
04-02-2015

Review thread: http://mail.openjdk.java.net/pipermail/core-libs-dev/2015-January/031140.html
29-01-2015

URL: http://hg.openjdk.java.net/jdk9/dev/jdk/rev/458adf31ad5b User: darcy Date: 2015-01-29 23:14:53 +0000
29-01-2015