You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Emi (Jira)" <ji...@apache.org> on 2020/01/02 16:44:00 UTC

[jira] [Created] (THRIFT-5056) Netstd Generated GetHashCode() returns same value in many common cases

Emi created THRIFT-5056:
---------------------------

             Summary: Netstd Generated GetHashCode() returns same value in many common cases
                 Key: THRIFT-5056
                 URL: https://issues.apache.org/jira/browse/THRIFT-5056
             Project: Thrift
          Issue Type: Bug
          Components: netstd - Compiler
    Affects Versions: 0.13.0
            Reporter: Emi


Simple Thrift example which breaks the generated GetHashCode() implementation:
{code:java}
struct Simple
{
  1: optional bool A;
  2: optional bool B;
}
{code}
The generated GetHashCode() implementation using netstd generator returns the same value if one only of the A,B fields is set:
{code:java}
Assert.NotEqual(new Simple{A = true}.GetHashCode(), new Simple{B = true}.GetHashCode());
{code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)