You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "stack (JIRA)" <ji...@apache.org> on 2013/09/04 02:31:52 UTC
[jira] [Resolved] (HBASE-9427) Copy constructor of
ImmutableBytesWritable needs to consider the offset
[ https://issues.apache.org/jira/browse/HBASE-9427?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
stack resolved HBASE-9427.
--------------------------
Resolution: Duplicate
Dup of HBASE-8781 according to Vasu
> Copy constructor of ImmutableBytesWritable needs to consider the offset
> -----------------------------------------------------------------------
>
> Key: HBASE-9427
> URL: https://issues.apache.org/jira/browse/HBASE-9427
> Project: HBase
> Issue Type: Bug
> Reporter: Vasu Mariyala
>
> A simple test below
> {code}
> byte[] bytes = {'a','b','c','d','e','f'};
> ImmutableBytesWritable writable1 = new ImmutableBytesWritable(bytes, 1, bytes.length);
> ImmutableBytesWritable writable2 = new ImmutableBytesWritable(writable1);
> Assert.assertTrue("Mismatch", writable1.equals(writable2));
> {code}
> would fail with AssertionFailedError.
> The reason for this is
> {code}
> public ImmutableBytesWritable(final ImmutableBytesWritable ibw) {
> this(ibw.get(), 0, ibw.getSize());
> }
> {code}
> the constructor would always assume 0 as the offset while it can get it from ibw.getOffset() method.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira