[ 
https://issues.apache.org/jira/browse/THRIFT-2004?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Roger Meier resolved THRIFT-2004.
---------------------------------
    Resolution: Fixed

> Thrift::Union violates :== method contract and crashes
> ------------------------------------------------------
>
>                 Key: THRIFT-2004
>                 URL: https://issues.apache.org/jira/browse/THRIFT-2004
>             Project: Thrift
>          Issue Type: Bug
>          Components: Ruby - Library
>    Affects Versions: 0.9
>         Environment: MacOS X, ruby 1.9 and 2.0
>            Reporter: Jeff Reinecke
>            Priority: Minor
>
> Thrift::Union violates the contract for the :== method, by assuming that the 
> passed argument is either nil or a Thrift::Union (by calling methods that 
> only exist on Thrift::Union).  An extra clause should be put in to test if it 
> is not a Union and fail.
> Idiomatically, this should be done via duck typing making the method be:
> def ==(other)
>   nil && other.repond_to?(:get_set_field) && other.respond_to?(:get_value) && 
> @setfield == other.get_set_field && @value == other.get_value
> end



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to