You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Henrique Mendonca (JIRA)" <ji...@apache.org> on 2013/02/25 10:50:13 UTC

[jira] [Resolved] (THRIFT-1862) Java thrift generated coe: default constructor initialize fields with default values but doesn't set their isSet flags

     [ https://issues.apache.org/jira/browse/THRIFT-1862?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henrique Mendonca resolved THRIFT-1862.
---------------------------------------

    Resolution: Duplicate
    
> Java thrift generated coe: default constructor initialize fields with default values but doesn't set their isSet flags
> ----------------------------------------------------------------------------------------------------------------------
>
>                 Key: THRIFT-1862
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1862
>             Project: Thrift
>          Issue Type: Bug
>          Components: Java - Compiler
>    Affects Versions: 0.5
>         Environment: Mac
>            Reporter: Jin Feng
>            Priority: Minor
>
> I have thrift:
> {code}
> const i16 CURRENT_VERSION = 10;
> struct SomeMsg {
>   1: optional i16 currentVersion = CURRENT_VERSION;
> }
> {code}
> Now, when the follow test will fail:
> {code}
>   SomeMsg msg = new SomeMsg();
>   assertEquals(Constants.CURRENT_VESRION, msg.getCurrentVersion()); // pass
>   assertTrue(msg.isSetCurrentVersion()); // fail.
> {code}
> Question is: is this behavior by design?

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