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

(coll) PriorityQueue.fixUp() use >> instead of >>>

XMLWordPrintable

      FULL PRODUCT VERSION :
      java version "1.6.0-rc"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.6.0-rc-b61)
      Java HotSpot(TM) Client VM (build 1.6.0-rc-b61, mixed mode, sharing)


      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows XP [version 5.1.2600]

      A DESCRIPTION OF THE PROBLEM :
      In the class PriorityQueue, the method fixUp contains
      twice a similary code. (one with a comparator and
      one with comparable)

      in the comparable version, to obtain the parent,
      the line is 'int j = k >> 1;'
      in the comparator version,
      the line is 'int j = k >>> 1;'

      the comparable version use a >> instead of a >>>,
      so the sign bit is not shift as it does.


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      i have read the source, so i don't have any test.


      REPRODUCIBILITY :
      This bug can be reproduced always.

      CUSTOMER SUBMITTED WORKAROUND :
      Use a comparator instead of a comparable.

            martin Martin Buchholz
            ndcosta Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: