[ https://issues.apache.org/jira/browse/AVRO-2641?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Magne Moss Helleborg updated AVRO-2641: --------------------------------------- Description: SpecificRecord put() used by datumreader does not account for that String fields can be represented as org.apache.avro.util.Utf8 or other CharSequence which might not be castable to java.lang.String. The result is that when it tries to deserialize Utf8-fields it fails with a ClassCastException. Proposed solution: toString() instead of cast for Strings. To reproduce error: Serialize from the C# was: SpecificRecord put() used by datumreader does not account for that String fields can be represented as org.apache.avro.util.Utf8 or other CharSequence which might not be castable to java.lang.String. The result is that when it tries to deserialize Utf8-fields it fails with a ClassCastException. Proposed solution: toString() instead of cast for Strings. > Generated code results in java.lang.ClassCastException when deserializing > ------------------------------------------------------------------------- > > Key: AVRO-2641 > URL: https://issues.apache.org/jira/browse/AVRO-2641 > Project: Apache Avro > Issue Type: Bug > Components: java > Affects Versions: 1.8.0 > Reporter: Magne Moss Helleborg > Priority: Major > > SpecificRecord put() used by datumreader does not account for that String > fields can be represented as org.apache.avro.util.Utf8 or other CharSequence > which might not be castable to java.lang.String. > The result is that when it tries to deserialize Utf8-fields it fails with a > ClassCastException. > Proposed solution: toString() instead of cast for Strings. > > To reproduce error: Serialize from the C# -- This message was sent by Atlassian Jira (v8.3.4#803005)