[
https://issues.apache.org/jira/browse/THRIFT-4?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12601814#action_12601814
]
Kevin Ballard commented on THRIFT-4:
------------------------------------
I just pushed a fix for this to my git fork
http://github.com/kballard/thrift/commit/9bc01fd62e9bc6bb624ea0033c562bb03c529644
It's a different fix, though - instead of switching based on the type of the
object, I believe it's simpler to do (default.dup rescue default).
> Default values of non-primitive types aren't copied on new object creation
> --------------------------------------------------------------------------
>
> Key: THRIFT-4
> URL: https://issues.apache.org/jira/browse/THRIFT-4
> Project: Thrift
> Issue Type: Bug
> Components: Library (Ruby)
> Reporter: Bryan Duxbury
> Assignee: Bryan Duxbury
> Attachments: equality_and_defaults_release.patch, thrift-4.patch
>
>
> If you create a Thrift type that has a default value for a field, and the
> default value is non-primitive (a hash, thrift object, array, etc), then all
> instances of that class share the same default object instead of copies of
> that object.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.