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

java.util.Date.hashCode is using '>>' instead of '>>>' operator

    Details

      Description

      A DESCRIPTION OF THE PROBLEM :
      The javadoc for java.util.Date#hashCode() says that hash code is the value of the expression:
      (int)(this.getTime()^(this.getTime() >>> 32))

      However the actual code is using '>>' only:
              long ht = this.getTime();
              return (int) ht ^ (int) (ht >> 32);

      If we check the java.lang.Long#hashCode() implementation, it is using '>>>' per documented. So is this java.util.Date#hashCode a javadoc problem, or implementation oversight?



        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              webbuggrp Webbug Group
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: