You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Vitali Lovich (JIRA)" <ji...@apache.org> on 2013/06/20 18:03:20 UTC
[jira] [Commented] (THRIFT-1946) Non-optional field setters don't
set __isset to true
[ 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