[infinispan-issues] [JBoss JIRA] (ISPN-2167) TestObjectStreamMarshaller doesn't use offset and size arguments

William Burns (JIRA) jira-events at lists.jboss.org
Fri Jul 20 11:52:06 EDT 2012


William Burns created ISPN-2167:
-----------------------------------

             Summary: TestObjectStreamMarshaller doesn't use offset and size arguments
                 Key: ISPN-2167
                 URL: https://issues.jboss.org/browse/ISPN-2167
             Project: Infinispan
          Issue Type: Bug
    Affects Versions: 5.2.0.ALPHA1
            Reporter: William Burns
            Assignee: Manik Surtani


The TestObjectStreamMarshaller.objectFromByteBuffer(byte[], int, int) method does not actually pass the array with offsets.  The code made a copy using the offset and size, but then passes the wrong byte array in.  This is causing some issues with some tests I am writing for a CacheStore that I had to work around for now.

I personally don't see why it creates a copy of the array when it could just pass in the offset and size directly and not incur the cost of copying the byte array again.  I have a fix that just passes the offset and index directly to the ByteArrayInputStream instead of doing the copy.  If you feel that the copy is still needed obviously then just change it to pass in newBytes as the change instead.

I will attach a pull request soon.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the infinispan-issues mailing list