JDK-8033792 : AltHashing used jint for imprecise bit shifting
Type:Bug
Component:hotspot
Sub-Component:runtime
Affected Version:7,8,9
Priority:P4
Status:Closed
Resolution:Fixed
OS:generic
CPU:generic
Submitted:2014-02-06
Updated:2014-08-18
Resolved:2014-02-11
The Version table provides details related to the release that this issue/RFE will be addressed.
Unresolved : Release in which this issue/RFE will be addressed. Resolved: Release in which this issue/RFE has been resolved. Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.
It is not precise when do bit shifting with signed int (jint). In AltHashing, conversion between jint and 'unsigned int' could cause loss of precision. The solution is using juint for operation and before return cast result to jint.
Comments
using 'juint' as temporary variable for bit operation to get result, and before return cast result to 'jint'.