[ https://issues.apache.org/jira/browse/HBASE-9427?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13757290#comment-13757290 ]
Vasu Mariyala commented on HBASE-9427: -------------------------------------- This issue is a duplicate of HBASE-8781 and i was looking at 0.94 code base. This can be closed as duplicate. > 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