You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Bryan Duxbury (JIRA)" <ji...@apache.org> on 2012/06/26 18:46:44 UTC
[jira] [Closed] (THRIFT-1624) Isset Generated differently on
different platforms
[ https://issues.apache.org/jira/browse/THRIFT-1624?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Bryan Duxbury closed THRIFT-1624.
---------------------------------
Resolution: Fixed
Fix Version/s: 0.9
Assignee: Bryan Duxbury
> 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
> Assignee: Bryan Duxbury
> Fix For: 0.9
>
> Attachments: is_union_uninitialized.patch
>
>
> 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