-
Bug
-
Resolution: Fixed
-
P4
-
6
-
b78
-
x86
-
windows_xp
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.
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.
- relates to
-
JDK-6394004 (coll) Thread-safety and Performance improvements to PriorityQueue
-
- Closed
-