[ 
https://issues.apache.org/jira/browse/AVRO-1064?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13654918#comment-13654918
 ] 

Doug Cutting commented on AVRO-1064:
------------------------------------

If you intend a string to be nullable and are generating Java code from an Avro 
schema, then the appropriate type is ["null", "string"], a union of null and 
string.
                
> Encoder.writeString throws NullPointerException when the charSequence is null
> -----------------------------------------------------------------------------
>
>                 Key: AVRO-1064
>                 URL: https://issues.apache.org/jira/browse/AVRO-1064
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.6.3
>            Reporter: Kevin Zhao
>         Attachments: Encoder.java.patch
>
>
> org.apache.avro.io.Encoder.writeString(CharSequence charSequence) throws 
> NullPointerException when dealing with a javabean which has a null value in 
> one of its fields, like the following one:
> Person person = new Person();
> person.setName("Kevin");
> person.setId(null);

--
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

Reply via email to