[
https://issues.apache.org/jira/browse/CASSANDRA-11973?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Stefania resolved CASSANDRA-11973.
----------------------------------
Resolution: Fixed
Fix Version/s: (was: 3.0.x)
(was: 3.x)
3.9
3.0.9
Note: 2.2.x should be 2.2.8 but the tag doesn't exist yet.
> Is MemoryUtil.getShort() supposed to return a sign-extended or
> non-sign-extended value?
> ---------------------------------------------------------------------------------------
>
> Key: CASSANDRA-11973
> URL: https://issues.apache.org/jira/browse/CASSANDRA-11973
> Project: Cassandra
> Issue Type: Bug
> Components: Core
> Reporter: Rei Odaira
> Assignee: Rei Odaira
> Priority: Minor
> Fix For: 3.0.9, 3.9, 2.2.x
>
> Attachments: 11973-2.2.txt
>
>
> 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"?
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)