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

Vitali Lovich commented on THRIFT-1946:
---------------------------------------

You need isSet for backwards compatibility.  If you add a non-optional 
non-required field, & you read in a thrift object generated from before you 
added the field, you need some way of knowing that it wasn't actually read in.
                
> Non-optional field setters don't set __isset to true
> ----------------------------------------------------
>
>                 Key: THRIFT-1946
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1946
>             Project: Thrift
>          Issue Type: Bug
>          Components: C++ - Compiler
>            Reporter: Vitali Lovich
>
> Optional fields __set_X modify the __isset structure for the object.  This is 
> not true of non-optional fields.  When the object is initialized, you have to 
> explicitly set the __isset field.  It would be nice if __set_X set __isset to 
> true for non-optional fields and optionally if __isset initialized to true 
> for non-optional fields.
> This causes a difference between C++ & Java code that handles isSetX for 
> non-optionals by just checking against 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