Details
-
Bug
-
Status: Resolved
-
Low
-
Resolution: Fixed
-
None
-
Low
Description
In org.apache.cassandra.utils.memory.MemoryUtil.getShort(), the returned value of unsafe.getShort(address) is bit-wise-AND'ed with 0xffff, while that of getShortByByte(address) is not. This inconsistency results in different returned values when the short integer is negative. Which is preferred behavior? Looking at NativeClustering and NativeCellTest, it seems like non-sign-extension is assumed.
By the way, is there any reason MemoryUtil.getShort() and MemoryUtil.getShortByByte() return "int", not "short"?