You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Mike Rettig (JIRA)" <ji...@apache.org> on 2014/12/03 23:21:14 UTC

[jira] [Created] (THRIFT-2877) Optimize generated hashCode

Mike Rettig created THRIFT-2877:
-----------------------------------

             Summary: Optimize generated hashCode
                 Key: THRIFT-2877
                 URL: https://issues.apache.org/jira/browse/THRIFT-2877
             Project: Thrift
          Issue Type: Improvement
          Components: Java - Compiler
    Affects Versions: 0.9.3
            Reporter: Mike Rettig
            Priority: Critical


The generated java hashCode method allocates an ArrayList then appends the fields to the list.  Primitive fields will be boxed when added to the list. 

The generated code shouldn't allocate a list or box primitives.  The hashCode can be calculated by using a primitive int and some static utility methods which can return the hashCode for each type.



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