avro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ryan Blue (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (AVRO-1799) java: GenericData.toString() mutates underlying ByteBuffer backed data
Date Thu, 25 Feb 2016 16:24:18 GMT

    [ https://issues.apache.org/jira/browse/AVRO-1799?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15167388#comment-15167388

Ryan Blue commented on AVRO-1799:

Thanks for reviewing Greg! I've updated the test as you suggested and I'll merge this later
today unless someone objects.

> java: GenericData.toString() mutates underlying ByteBuffer backed data
> ----------------------------------------------------------------------
>                 Key: AVRO-1799
>                 URL: https://issues.apache.org/jira/browse/AVRO-1799
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.8.0
>            Reporter: Greg McNutt
>            Priority: Critical
> Around line 550, the writeEscapedString() method, used to serialize a byte array, will
alter the underlying ByteBuffer's pointer.  Meaning subsequent uses of a toString()'d avro
object will yield different results.
> Need to not use a generic decode on a ByteBuffer; either clone the element (expensive),
or iterate over the elements with an external index.

This message was sent by Atlassian JIRA

View raw message