Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8199394

Object.hashCode should not mention anything about memory addresses

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 11
    • Fix Version/s: 12
    • Component/s: core-libs
    • Subcomponent:
    • Resolved In Build:
      b24

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                smarks Stuart Marks
                Reporter:
                smarks Stuart Marks
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: