hbase-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vasu Mariyala (JIRA)" <j...@apache.org>
Subject [jira] [Created] (HBASE-9427) Copy constructor of ImmutableBytesWritable needs to consider the offset
Date Wed, 04 Sep 2013 00:17:52 GMT
Vasu Mariyala created HBASE-9427:
------------------------------------

             Summary: 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

Mime
View raw message