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 Skraba (Jira)" <ji...@apache.org> on 2020/11/04 17:14:00 UTC

[jira] [Resolved] (AVRO-1854) NPE on recursive datatype in JSON encoder

     [ https://issues.apache.org/jira/browse/AVRO-1854?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ryan Skraba resolved AVRO-1854.
-------------------------------
    Resolution: Duplicate

> NPE on recursive datatype in JSON encoder
> -----------------------------------------
>
>                 Key: AVRO-1854
>                 URL: https://issues.apache.org/jira/browse/AVRO-1854
>             Project: Apache Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.7.7
>            Reporter: Douglas Kaminsky
>            Priority: Critical
>         Attachments: RecursiveFlattenBugRegression.java, symbolstack.png
>
>
> When trying to encode to JSON a record whose schema contains a recursive type embedded in another type (ie. an array), the "flatten" method in the {{Parser}} leaves a hole in the middle of the symbol stack which causes a NPE to occur. My best guess is that it's leaving space for the embedded recursion but never populating the symbol, but that code is a bit obtuse so I am having trouble getting to the root cause (otherwise I would have provided a patch to solve the problem as well).
> Attached is a class with a short main method that replicates the problem with anonymized versions of my datatypes/record and a screenshot of the symbol stack at runtime right before the error occurs.
> Not yet tested in 1.8.0 but should be easy to verify.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)