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 Reiss (JIRA)" <ji...@apache.org> on 2009/08/12 01:56:15 UTC

[jira] Commented: (THRIFT-226) Collections with binary keys or values break equals()

    [ https://issues.apache.org/jira/browse/THRIFT-226?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12742123#action_12742123 ] 

David Reiss commented on THRIFT-226:
------------------------------------

What would you guys think about using java.nio.ByteBuffer for the binary type?

> Collections with binary keys or values break equals()
> -----------------------------------------------------
>
>                 Key: THRIFT-226
>                 URL: https://issues.apache.org/jira/browse/THRIFT-226
>             Project: Thrift
>          Issue Type: Bug
>          Components: Compiler (Java)
>            Reporter: Bryan Duxbury
>             Fix For: 0.2
>
>
> In Java, byte[].equals tests object equality, not value equality. As a result, if you have two list<binary> (or set<binary>, or map<binary, binary> with the same values and you do TBase.equals(), two structs that match by value won't return true. If we're going to do value equality, which I think we should, then we should make this consistent with collection types.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.