avro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Douglas Kaminsky (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (AVRO-1365) NPE thrown when comparing objects using GenericData.compare
Date Fri, 23 Aug 2013 19:33:53 GMT

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

Douglas Kaminsky updated AVRO-1365:
-----------------------------------

    Description: 
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.
    
> 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
>
> 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 is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message