You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by br...@apache.org on 2009/11/17 22:56:44 UTC

svn commit: r881559 - /incubator/thrift/trunk/compiler/cpp/src/generate/t_java_generator.cc

Author: bryanduxbury
Date: Tue Nov 17 21:56:43 2009
New Revision: 881559

URL: http://svn.apache.org/viewvc?rev=881559&view=rev
Log:
THRIFT-628. java: Hash code method for _Fields objects does not behave as expected
This patch switches to using the hashcode of the actual field id, instead of the field id enumeration.

Modified:
    incubator/thrift/trunk/compiler/cpp/src/generate/t_java_generator.cc

Modified: incubator/thrift/trunk/compiler/cpp/src/generate/t_java_generator.cc
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/compiler/cpp/src/generate/t_java_generator.cc?rev=881559&r1=881558&r2=881559&view=diff
==============================================================================
--- incubator/thrift/trunk/compiler/cpp/src/generate/t_java_generator.cc (original)
+++ incubator/thrift/trunk/compiler/cpp/src/generate/t_java_generator.cc Tue Nov 17 21:56:43 2009
@@ -985,7 +985,7 @@
   if (gen_hash_code_) {
     indent(out) << "@Override" << endl;
     indent(out) << "public int hashCode() {" << endl;
-    indent(out) << "  return new HashCodeBuilder().append(getSetField()).append(getFieldValue()).toHashCode();" << endl;
+    indent(out) << "  return new HashCodeBuilder().append(getSetField().getThriftFieldId()).append(getFieldValue()).toHashCode();" << endl;
     indent(out) << "}";
   } else {
     indent(out) << "/**" << endl;