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

Sean Busbey updated AVRO-1365:
------------------------------
    Labels: beginner  (was: )

> NPE thrown when comparing objects using GenericData.compare
> -----------------------------------------------------------
>
>                 Key: AVRO-1365
>                 URL: https://issues.apache.org/jira/browse/AVRO-1365
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.7.5
>            Reporter: Douglas Kaminsky
>            Priority: Minor
>              Labels: beginner
>
> When comparing two objects using GenericData.compare (directly or 
> indirectly), null values in fields of record type objects are not 
> sufficiently protected against, resulting in NPE
> e.g.
> {code}
> case ENUM:
>   return s.getEnumOrdinal(o1.toString()) - s.getEnumOrdinal(o2.toString());
> {code}
> This is prevalent throughout the {{compare}} method. This impacts 
> {{compareTo}}, and {{equals}} implementations as well.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to