[
https://issues.apache.org/jira/browse/AVRO-790?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Scott Carey updated AVRO-790:
-----------------------------
Attachment: AVRO-790.patch
A patch that fixes the issue and contains an enhanced unit test that exposes it.
> Java: GenericDatumReader can fail when reusing objects with unions containing
> 'bytes' fields
> --------------------------------------------------------------------------------------------
>
> Key: AVRO-790
> URL: https://issues.apache.org/jira/browse/AVRO-790
> Project: Avro
> Issue Type: Bug
> Components: java
> Reporter: Scott Carey
> Assignee: Scott Carey
> Fix For: 1.5.1
>
> Attachments: AVRO-790.patch
>
>
> GenericDatumReader can fail when reusing GenericRecord objects that contain
> unions of 'bytes' and other types.
> Enhanced unit tests in TestSchema.java uncovered this.
> Errors are of the form:
> {code}
> java.lang.ClassCastException: org.apache.avro.generic.GenericData$Array
> cannot be cast to java.nio.ByteBuffer
> at
> org.apache.avro.generic.GenericDatumReader.readBytes(GenericDatumReader.java:333)
> at
> org.apache.avro.generic.GenericDatumReader.read(GenericDatumReader.java:145)
> at
> org.apache.avro.generic.GenericDatumReader.read(GenericDatumReader.java:142)
> at
> org.apache.avro.generic.GenericDatumReader.read(GenericDatumReader.java:129)
> {code}
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira