You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Nathaniel Cook (JIRA)" <ji...@apache.org> on 2012/06/07 19:29:23 UTC

[jira] [Created] (THRIFT-1624) Isset Generated differently on different platforms

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

        

[jira] [Commented] (THRIFT-1624) Isset Generated differently on different platforms

Posted by "Brian Bloniarz (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1624?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13401020#comment-13401020 ] 

Brian Bloniarz commented on THRIFT-1624:
----------------------------------------

Hey Bryan, would you consider merging this patch?

Nathaniel never replied to confirm that it fixed his issue, but fixing an uninitialized variable couldn't hurt.
                
> 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
>         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

        

[jira] [Commented] (THRIFT-1624) Isset Generated differently on different platforms

Posted by "Nathaniel Cook (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1624?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13401093#comment-13401093 ] 

Nathaniel Cook commented on THRIFT-1624:
----------------------------------------

Sorry I forgot to get back to you on this. The patch worked great. Feel free to close the issue.
                
> 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
>         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

        

[jira] [Commented] (THRIFT-1624) Isset Generated differently on different platforms

Posted by "Nathaniel Cook (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1624?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13291301#comment-13291301 ] 

Nathaniel Cook commented on THRIFT-1624:
----------------------------------------

Yes, they are the same version. I compiled them both from trunk.
                
> 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

        

[jira] [Commented] (THRIFT-1624) Isset Generated differently on different platforms

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1624?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13401083#comment-13401083 ] 

Hudson commented on THRIFT-1624:
--------------------------------

Integrated in Thrift #506 (See [https://builds.apache.org/job/Thrift/506/])
    THRIFT-1624. java: Isset Generated differently on different platforms

This patch initializes is_union_ to a specific value to try and avoid the issue.

Patch: Brian Bloniarz (Revision 1353784)

     Result = SUCCESS
bryanduxbury : http://svn.apache.org/viewvc/?view=rev&rev=1353784
Files : 
* /thrift/trunk/compiler/cpp/src/parse/t_struct.h

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

        

[jira] [Commented] (THRIFT-1624) Isset Generated differently on different platforms

Posted by "Bryan Duxbury (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1624?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13401070#comment-13401070 ] 

Bryan Duxbury commented on THRIFT-1624:
---------------------------------------

I just committed this patch. Should we close this ticket?
                
> 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
>         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

        

[jira] [Closed] (THRIFT-1624) Isset Generated differently on different platforms

Posted by "Bryan Duxbury (JIRA)" <ji...@apache.org>.
     [ 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

        

[jira] [Updated] (THRIFT-1624) Isset Generated differently on different platforms

Posted by "Brian Bloniarz (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-1624?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brian Bloniarz updated THRIFT-1624:
-----------------------------------

    Attachment: is_union_uninitialized.patch

Nathaniel, could you see if the following patch fixes the issue?
                
> 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
>         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

        

[jira] [Comment Edited] (THRIFT-1624) Isset Generated differently on different platforms

Posted by "Brian Bloniarz (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1624?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13291333#comment-13291333 ] 

Brian Bloniarz edited comment on THRIFT-1624 at 6/7/12 9:41 PM:
----------------------------------------------------------------

Here's a theory: maybe t_struct::is_union_ is just an uninitialized variable?

The t_struct constructor doesn't initialize it. thrifty.yy line 724 will initialize it for struct/union declarations, but I'm guessing that codepath is skipped for service declarations.

                
      was (Author: brianbloniarz):
    Here's a theory: maybe t_struct::is_union_ is just an uninitialized variable?

The t_struct constructor doesn't initialize it. thrift.yy line 724 will initialize it for struct/union declarations, but I'm guessing that codepath is skipped for service declarations.

                  
> 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

        

[jira] [Commented] (THRIFT-1624) Isset Generated differently on different platforms

Posted by "Brian Bloniarz (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1624?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13291333#comment-13291333 ] 

Brian Bloniarz commented on THRIFT-1624:
----------------------------------------

Here's a theory: maybe t_struct::is_union_ is just an uninitialized variable?

The t_struct constructor doesn't initialize it. thrift.yy line 724 will initialize it for struct/union declarations, but I'm guessing that codepath is skipped for service declarations.

                
> 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

        

[jira] [Commented] (THRIFT-1624) Isset Generated differently on different platforms

Posted by "Bryan Duxbury (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1624?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13291294#comment-13291294 ] 

Bryan Duxbury commented on THRIFT-1624:
---------------------------------------

Are you using the same versions of thrift between your two hosts? And where did you get them from?
                
> 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