Nathaniel Cook created THRIFT-1624:
--------------------------------------
Summary: Isset Generated differently on different platforms
Key: THRIFT-1624
URL: https://issues.apache.org/jira/browse/THRIFT-1624
Project: Thrift
Issue Type: Bug
Components: Compiler (General), Java - Compiler
Affects Versions: 0.9
Environment: CentOS 5 Mac OS X
Reporter: Nathaniel Cook
Genereated java code is different depending on the environment.
Example Service:
{code}
service IssetService
{
bool test()
}
{code}
CentOS 5 result:
{code:java}
private void readObject(java.io.ObjectInputStream in) throws
java.io.IOException, ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new
org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
{code}
Mac OS X result:
{code:java}
private void readObject(java.io.ObjectInputStream in) throws
java.io.IOException, ClassNotFoundException {
try {
// it doesn't seem like you should have to do this, but java
serialization is wacky, and doesn't call the default constructor.
__isset_bitfield = 0;
read(new org.apache.thrift.protocol.TCompactProtocol(new
org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
{code}
The inconsistency is a problem as we have a hybrid env. Also we are unsure
which is correct.
I have dug around in the code and is seems to come down to this method
"tstruct->is_union()". On CentOS the struct is a union so the 'isset' code is
omitted. While the opposite is true for Mac OS X. I am still unsure as to the
cause but before I submit a patch I need to know which is correct.
--
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