NPE in ReflectData 
-------------------

                 Key: AVRO-542
                 URL: https://issues.apache.org/jira/browse/AVRO-542
             Project: Avro
          Issue Type: Bug
          Components: java
    Affects Versions: 1.3.2
         Environment: Java
            Reporter: Douglas Britsch


On line 253 of ReflectData.java the package is retrieved with:

String space = c.getPackage().getName();

getPackage is documented to be able to return null, and in practice does with 
generated classes and in certain child classloader scenarios. A safer 
alternative would be to derive the package by passing the string returned from 
the class's name:

String space = c.getName().substring(0, name.lastIndexOf('.'); 

Thanks

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to