[ https://issues.apache.org/jira/browse/CASSANDRA-1661?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12924628#action_12924628
]
Stu Hood commented on CASSANDRA-1661:
-------------------------------------
> better to treat ByteBuffers as immutable so avoid changing position and mark
In cases where the buffer should be immutable, you'd need to duplicate() it first.
> should be fixed in this patch ok, but it seems like a small issue
It's a small function: waiting any longer to add it isn't worth it, imo.
> I put it in there incase others have questions about how ByteBuffers work.
I'm out-numbered on this one I guess.
> Use of ByteBuffer limit() must account for arrayOffset()
> ---------------------------------------------------------
>
> Key: CASSANDRA-1661
> URL: https://issues.apache.org/jira/browse/CASSANDRA-1661
> Project: Cassandra
> Issue Type: Bug
> Components: Core
> Affects Versions: 0.7.0
> Reporter: T Jake Luciani
> Assignee: T Jake Luciani
> Fix For: 0.7.0
>
> Attachments: 1661_v1.txt
>
>
> There are a few places in the code where it loops across a byte buffers backing array
wrong:
> for (int i=bytes.position()+bytes.arrayOffset(); i<bytes.limit(); i++)
> This is incorrect as the limit() does not account for arrayOffset()
> for (int i=bytes.position()+bytes.arrayOffset(); i<bytes.limit()+bytes.arrayOffset();
i++)
> is the correct code.
> There is also a few places where the unit tests would fail if we used non wrapped byte
arrays.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
|