cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stu Hood (JIRA)" <>
Subject [jira] Commented: (CASSANDRA-1661) Use of ByteBuffer limit() must account for arrayOffset()
Date Mon, 25 Oct 2010 18:44:19 GMT


Stu Hood commented on CASSANDRA-1661:

+1 All that is left is nitpicks, which you can choose to ignore:

> Cleans up tests with new BBUtil call
A static import might be the last bit of sugar to make this a real win.

Code style dictates that there should be spaces around operators.

> Use of ByteBuffer limit() must account for arrayOffset() 
> ---------------------------------------------------------
>                 Key: CASSANDRA-1661
>                 URL:
>             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, 1661_v2.txt
> There are a few places in the code where it loops across a byte buffers backing array
>         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();
> is the correct code.
> There is also a few places where the unit tests would fail if we used non wrapped byte

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message