[
https://issues.apache.org/jira/browse/AVRO-2383?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16828983#comment-16828983
]
ASF subversion and git services commented on AVRO-2383:
-------------------------------------------------------
Commit 196777ccc2e698e9dba153d48a08ef4b68b144a1 in avro's branch
refs/heads/master from Raman Gupta
[ https://gitbox.apache.org/repos/asf?p=avro.git;h=196777c ]
AVRO-2383: NPE during Schema.applyAliases (#510)
> Avro 1.9 applyAliases broken with self-referential records
> ----------------------------------------------------------
>
> Key: AVRO-2383
> URL: https://issues.apache.org/jira/browse/AVRO-2383
> Project: Apache Avro
> Issue Type: Bug
> Components: java
> Affects Versions: 1.9.0
> Reporter: Raman Gupta
> Priority: Blocker
> Fix For: 1.9.0
>
> Attachments: AVRO-2383.patch
>
>
> If a schema has a field with a self-referential record, the applyAliases
> function produces a NullPointerException.
> The problem appears to be that the value for the record put into "seen" has
> no fields, and then when the equality check is done, the `Schema.equals`
> method assumes that fields is not null. Making the `equals` method more
> defensive with null-checking "fields" solves the problem, as the `putAll`
> method adds the fields back in, but I'm not sure if that is actually the best
> fix.
> I will attach a patch with this fix.
> I'm marking this as a blocker for 1.9, as this behavior will cause a
> NullPointerException in this situation any time data is decoded where the
> writer and reader schema are different, and there are any aliases defined in
> the reader (even if these aliases are unrelated to the self-referential
> record).
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)