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

Hudson commented on THRIFT-3001:
--------------------------------

SUCCESS: Integrated in Thrift #1459 (See 
[https://builds.apache.org/job/Thrift/1459/])
THRIFT-3001 C# Equals fails for binary fields (byte[]) (jensg: rev 
80aa53e6bcc766a985d7a05c20e85e21e2bdd65f)
* lib/csharp/test/ThriftTest/TestClient.cs
* compiler/cpp/src/generate/t_csharp_generator.cc


> C# Equals fails for binary fields (byte[])
> ------------------------------------------
>
>                 Key: THRIFT-3001
>                 URL: https://issues.apache.org/jira/browse/THRIFT-3001
>             Project: Thrift
>          Issue Type: Bug
>          Components: C# - Compiler
>    Affects Versions: 0.9.2
>         Environment: Windows, OSX (most probably all others as well)
>            Reporter: Benjamin Schulz
>            Assignee: Jens Geyer
>            Priority: Minor
>              Labels: patch
>             Fix For: 0.9.3
>
>         Attachments: THRIFT-3001-C-Equals-fails-for-binary-fields-byte.patch, 
> fix_Equals_for_binary_fields_in_csharp.diff
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> The genrated code for Equals is using System.Object.Equals() for byte[].
> byte[] a = {1};
> byte[] b = {1};
> bool equals1 = System.Object.Equals(a, b);
> bool equals2 = Thrift.Collections.TCollections.Equals(a, b);
> equals1 ist False and equals2 is True.
> The effects is, that two thrift-objects that have binary fields never compare 
> Equal.
> test/reproduction:
> - create a thrift-model with a binary field.
> - compile this thrift-model with the c# compiler with the hashcode option 
> enabled.
> - create two instances of this model (o1, o2) and fill the binary filed with 
> equal data
> - note the result of o1.Equals(o2)
> fix: in t_csharp_generator.cc: change the check in the "Equals"-generator to 
> also use TCollections.Equals for the binary type



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

Reply via email to