You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "david herviou (JIRA)" <ji...@apache.org> on 2010/05/05 10:22:02 UTC
[jira] Created: (THRIFT-772) __isset_bit_vector state before
serialization differs from state after serialization on native field
__isset_bit_vector state before serialization differs from state after serialization on native field
----------------------------------------------------------------------------------------------------
Key: THRIFT-772
URL: https://issues.apache.org/jira/browse/THRIFT-772
Project: Thrift
Issue Type: Bug
Components: Library (Java)
Affects Versions: 0.2
Environment: Linux, thrift release 0.2.0 with patch Thrift-746 and Thrift-663
Reporter: david herviou
Once java classes have been generated it is possible to test if the fields have been set or not using the method isSetXXX().
Once one of this java class is instanciated, all call to field.isSetXXX() are returning false which is a good thing (this method ask for __isset_bit_vector.get(XXX))
Now if you serialize the previous object and unserialize it (without doing any changes on it) the following occured : all fields that corresponds to native data are returning true when isSetXXX() is invoked.
Consequently, the operation unserialise(serialize(object)) is not an identity function.
This is mainly due that the __isset_bit_vector is not serialize and rebuild during the unserialize operation.
Any idea how to fix this ?
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Closed: (THRIFT-772) __isset_bit_vector state before
serialization differs from state after unserialization on native field
Posted by "Bryan Duxbury (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/THRIFT-772?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Bryan Duxbury closed THRIFT-772.
--------------------------------
Resolution: Won't Fix
At least until we decide to get rid of the "default" requiredness, then I think we should close this issue.
> __isset_bit_vector state before serialization differs from state after unserialization on native field
> ------------------------------------------------------------------------------------------------------
>
> Key: THRIFT-772
> URL: https://issues.apache.org/jira/browse/THRIFT-772
> Project: Thrift
> Issue Type: Bug
> Components: Library (Java)
> Affects Versions: 0.2
> Environment: Linux, thrift release 0.2.0 with patch Thrift-746 and Thrift-663
> Reporter: david herviou
> Attachments: thrift-issue-bitset-nativefields.tgz
>
>
> Once java classes have been generated it is possible to test if the fields have been set or not using the method isSetXXX().
> Once one of this java class is instanciated, all call to field.isSetXXX() are returning false which is a good thing (this method ask for __isset_bit_vector.get(XXX))
> Now if you serialize the previous object and unserialize it (without doing any changes on it) the following occured : all fields that corresponds to native data are returning true when isSetXXX() is invoked.
> Consequently, the operation unserialise(serialize(object)) is not an identity function.
> This is mainly due that the __isset_bit_vector is not serialize and rebuild during the unserialize operation.
> Any idea how to fix this ?
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (THRIFT-772) __isset_bit_vector state before
serialization differs from state after unserialization on native field
Posted by "david herviou (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/THRIFT-772?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
david herviou updated THRIFT-772:
---------------------------------
Summary: __isset_bit_vector state before serialization differs from state after unserialization on native field (was: __isset_bit_vector state before serialization differs from state after serialization on native field)
> __isset_bit_vector state before serialization differs from state after unserialization on native field
> ------------------------------------------------------------------------------------------------------
>
> Key: THRIFT-772
> URL: https://issues.apache.org/jira/browse/THRIFT-772
> Project: Thrift
> Issue Type: Bug
> Components: Library (Java)
> Affects Versions: 0.2
> Environment: Linux, thrift release 0.2.0 with patch Thrift-746 and Thrift-663
> Reporter: david herviou
> Attachments: thrift-issue-bitset-nativefields.tgz
>
>
> Once java classes have been generated it is possible to test if the fields have been set or not using the method isSetXXX().
> Once one of this java class is instanciated, all call to field.isSetXXX() are returning false which is a good thing (this method ask for __isset_bit_vector.get(XXX))
> Now if you serialize the previous object and unserialize it (without doing any changes on it) the following occured : all fields that corresponds to native data are returning true when isSetXXX() is invoked.
> Consequently, the operation unserialise(serialize(object)) is not an identity function.
> This is mainly due that the __isset_bit_vector is not serialize and rebuild during the unserialize operation.
> Any idea how to fix this ?
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (THRIFT-772) __isset_bit_vector state before
serialization differs from state after unserialization on native field
Posted by "david herviou (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/THRIFT-772?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12864686#action_12864686 ]
david herviou commented on THRIFT-772:
--------------------------------------
Indeed, putting fields 'optional' will does the trick. But actually the thing that make me a little bit embarass is the non identity of unserialize(serialize(object)) behavior for the bit set.
If this is something assumed and not to be used this way, that's ok.
Do you want this issue status to be changed ? or is this something you want to keep an eye on ?
> __isset_bit_vector state before serialization differs from state after unserialization on native field
> ------------------------------------------------------------------------------------------------------
>
> Key: THRIFT-772
> URL: https://issues.apache.org/jira/browse/THRIFT-772
> Project: Thrift
> Issue Type: Bug
> Components: Library (Java)
> Affects Versions: 0.2
> Environment: Linux, thrift release 0.2.0 with patch Thrift-746 and Thrift-663
> Reporter: david herviou
> Attachments: thrift-issue-bitset-nativefields.tgz
>
>
> Once java classes have been generated it is possible to test if the fields have been set or not using the method isSetXXX().
> Once one of this java class is instanciated, all call to field.isSetXXX() are returning false which is a good thing (this method ask for __isset_bit_vector.get(XXX))
> Now if you serialize the previous object and unserialize it (without doing any changes on it) the following occured : all fields that corresponds to native data are returning true when isSetXXX() is invoked.
> Consequently, the operation unserialise(serialize(object)) is not an identity function.
> This is mainly due that the __isset_bit_vector is not serialize and rebuild during the unserialize operation.
> Any idea how to fix this ?
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (THRIFT-772) __isset_bit_vector state before
serialization differs from state after serialization on native field
Posted by "david herviou (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/THRIFT-772?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
david herviou updated THRIFT-772:
---------------------------------
Attachment: thrift-issue-bitset-nativefields.tgz
I've attached the unit test for this use case.
> __isset_bit_vector state before serialization differs from state after serialization on native field
> ----------------------------------------------------------------------------------------------------
>
> Key: THRIFT-772
> URL: https://issues.apache.org/jira/browse/THRIFT-772
> Project: Thrift
> Issue Type: Bug
> Components: Library (Java)
> Affects Versions: 0.2
> Environment: Linux, thrift release 0.2.0 with patch Thrift-746 and Thrift-663
> Reporter: david herviou
> Attachments: thrift-issue-bitset-nativefields.tgz
>
>
> Once java classes have been generated it is possible to test if the fields have been set or not using the method isSetXXX().
> Once one of this java class is instanciated, all call to field.isSetXXX() are returning false which is a good thing (this method ask for __isset_bit_vector.get(XXX))
> Now if you serialize the previous object and unserialize it (without doing any changes on it) the following occured : all fields that corresponds to native data are returning true when isSetXXX() is invoked.
> Consequently, the operation unserialise(serialize(object)) is not an identity function.
> This is mainly due that the __isset_bit_vector is not serialize and rebuild during the unserialize operation.
> Any idea how to fix this ?
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (THRIFT-772) __isset_bit_vector state before
serialization differs from state after unserialization on native field
Posted by "Bryan Duxbury (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/THRIFT-772?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12864380#action_12864380 ]
Bryan Duxbury commented on THRIFT-772:
--------------------------------------
I'll glance at your unit test when I get a chance, but are your struct's fields "default" (that is, not required or optional)? If so, then no matter what the state of isset is, native fields will be serialized, and thus deserialized.
This is a holdover from earlier times which I'm not particularly crazy about, but the good news is that you can work around it by making optional/required explicit on every field.
> __isset_bit_vector state before serialization differs from state after unserialization on native field
> ------------------------------------------------------------------------------------------------------
>
> Key: THRIFT-772
> URL: https://issues.apache.org/jira/browse/THRIFT-772
> Project: Thrift
> Issue Type: Bug
> Components: Library (Java)
> Affects Versions: 0.2
> Environment: Linux, thrift release 0.2.0 with patch Thrift-746 and Thrift-663
> Reporter: david herviou
> Attachments: thrift-issue-bitset-nativefields.tgz
>
>
> Once java classes have been generated it is possible to test if the fields have been set or not using the method isSetXXX().
> Once one of this java class is instanciated, all call to field.isSetXXX() are returning false which is a good thing (this method ask for __isset_bit_vector.get(XXX))
> Now if you serialize the previous object and unserialize it (without doing any changes on it) the following occured : all fields that corresponds to native data are returning true when isSetXXX() is invoked.
> Consequently, the operation unserialise(serialize(object)) is not an identity function.
> This is mainly due that the __isset_bit_vector is not serialize and rebuild during the unserialize operation.
> Any idea how to fix this ?
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.