[
https://issues.apache.org/jira/browse/AVRO-1064?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13257609#comment-13257609
]
Thiruvalluvan M. G. commented on AVRO-1064:
-------------------------------------------
The patch makes Encoder treat {{null}} for Avro {{String}} as empty. There is
no such requirement in Encoder's specification. This would make the the spec
somewhat non-uniform. For example, if we assign the interpretation for {{null}}
for Avro {{String}}, we should also add interpretation for {{null}} for Avro
{{bytes}}, {{fixed}} and so on.
I think ensuring the the bean doesn't have {{null}} member or annotating the
property {{@Nullable}} is a better way to handle this.
> 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
> Fix For: 1.7.0
>
> 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:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira