[
https://issues.apache.org/jira/browse/AVRO-2122?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16309653#comment-16309653
]
Nandor Kollar edited comment on AVRO-2122 at 1/3/18 1:34 PM:
-------------------------------------------------------------
Usually Github pull requests are preferred, on Github it easier to comment the
change than giving a feedback for a patch, but if you don't want to fork Avro,
or doesn't have a Github account, then a patch is also fine.
was (Author: nkollar):
Usually Github pull request are preferred, on Github it easier to comment the
change than giving a feedback for a patch, but if you don't want to fork Avro,
or doesn't have a Github account, then a patch is also fine.
> Cannot validate schemas with recursive definitions
> --------------------------------------------------
>
> Key: AVRO-2122
> URL: https://issues.apache.org/jira/browse/AVRO-2122
> Project: Avro
> Issue Type: Bug
> Components: java
> Affects Versions: 1.8.2
> Reporter: Bart
>
> Validating a schema with a recursive definition will lead to a stack
> overflow. When using the following schema definition:
> {noformat}
> @namespace("avro")
> protocol Unused {
> record Node {
> union { null, Node } value = null;
> }
> }
> {noformat}
> {code:java}
> final SchemaValidator backwardValidator = new SchemaValidatorBuilder()
> .canReadStrategy().validateLatest();
> backwardValidator.validate(Node.SCHEMA$, Arrays.asList(Node.SCHEMA$));
> {code}
> It results in a stack trace:
> {noformat}
> java.lang.StackOverflowError
> at org.apache.avro.io.parsing.Symbol.hasErrors(Symbol.java:406)
> at org.apache.avro.io.parsing.Symbol.hasErrors(Symbol.java:392)
> at org.apache.avro.io.parsing.Symbol.hasErrors(Symbol.java:383)
> at org.apache.avro.io.parsing.Symbol.hasErrors(Symbol.java:406)
> at org.apache.avro.io.parsing.Symbol.hasErrors(Symbol.java:392)
> at org.apache.avro.io.parsing.Symbol.hasErrors(Symbol.java:406)
> at org.apache.avro.io.parsing.Symbol.hasErrors(Symbol.java:374)
> at org.apache.avro.io.parsing.Symbol.hasErrors(Symbol.java:406)
> ...
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)