Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
1.10.0
-
None
Description
Someone created an Avro definition where the name of a record is case:
protocol Proto { record case { string value; } record Wrapper { case inner; } }
Code generation works and the generated Java code uses case$ for the class name of the record. There is no problem in writing the Java code itself, however, decoding with a SpecificRecord.getDecoder() fails with a ClassCastException:
class org.apache.avro.generic.GenericData$Record cannot be cast to class case$ (org.apache.avro.generic.GenericData$Record and case$ are in unnamed module of loader 'app') java.lang.ClassCastException: class org.apache.avro.generic.GenericData$Record cannot be cast to class case$ (org.apache.avro.generic.GenericData$Record and case$ are in unnamed module of loader 'app')
Attachments
Issue Links
- is related to
-
AVRO-2757 ReflectData still generates namespaces with dollar signs
- Resolved
- links to