You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Ryan Blue (JIRA)" <ji...@apache.org> on 2016/02/29 20:02:18 UTC
[jira] [Resolved] (AVRO-1799) java: GenericData.toString() mutates
underlying ByteBuffer backed data
[ https://issues.apache.org/jira/browse/AVRO-1799?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ryan Blue resolved AVRO-1799.
-----------------------------
Resolution: Fixed
Assignee: Ryan Blue
Fix Version/s: 1.9.0
Merged the fix. Thanks for reporting this, Greg!
> 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
> Assignee: Ryan Blue
> Priority: Critical
> Fix For: 1.9.0
>
>
> 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
(v6.3.4#6332)