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

James Baldassari commented on AVRO-996:
---------------------------------------

While investigating this issue I also found a couple of other bugs related to 
the specific record builder, this time in the generated code:
* The build() method does not validate that all required (i.e. non-nullable) 
fields have been set
* It's possible for build() to throw NPE when defaultValue(Field) returns null 
and then the result of that call is set in a primitive field

I'm also going to include the fixes for the above issues in this patch, unless 
anyone thinks it would be better to split them out into a separate issue/patch.
                
> Java: SpecificRecord builder pattern object copy fails with unions in some 
> cases
> --------------------------------------------------------------------------------
>
>                 Key: AVRO-996
>                 URL: https://issues.apache.org/jira/browse/AVRO-996
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.6.0, 1.6.1
>            Reporter: Scott Carey
>            Priority: Critical
>             Fix For: 1.6.2, 1.7.0
>
>         Attachments: AVRO-996.bug.patch
>
>
> I have a union of multiple records that fails to copy correctly with the 
> MySpecificRecord.newBuilder(recordToCopy).build(); pattern.
> I have a reproducible test case that I will attach shortly.

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

        

Reply via email to