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

Some SA classes could use better hashCode() implementation

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Fixed
    • P4
    • 17
    • 17
    • hotspot
    • None
    • b23

    Description

          public int hashCode() {
              // FIXME: suggestions on a better hash code?
              return (int) addr;
          }

      The upper 32-bits of the addr long value could be used in the hash code calculation. Long.hashCode(long value) can be used to accomplish this:

           (int)(this.longValue()^(this.longValue()>>>32))

      Attachments

        Issue Links

          Activity

            People

              cjplummer Chris Plummer
              cjplummer Chris Plummer
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: