Jin Feng created THRIFT-1862:
--------------------------------
Summary: 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