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 2010/04/22 02:27:42 UTC

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

Author: bryanduxbury
Date: Thu Apr 22 00:27:41 2010
New Revision: 936583

URL: http://svn.apache.org/viewvc?rev=936583&view=rev
Log:
THRIFT-763. java: Variable capture bug in generated struct compareTo

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=936583&r1=936582&r2=936583&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 Thu Apr 22 00:27:41 2010
@@ -1387,7 +1387,7 @@ void t_java_generator::generate_java_str
     indent(out) << "}" << endl;
 
     indent(out) << "if (" << generate_isset_check(field) << ") {";
-    indent(out) << "  lastComparison = TBaseHelper.compareTo(" << field->get_name() << ", typedOther." << field->get_name() << ");" << endl;
+    indent(out) << "  lastComparison = TBaseHelper.compareTo(this." << field->get_name() << ", typedOther." << field->get_name() << ");" << endl;
     indent(out) << "  if (lastComparison != 0) {" << endl;
     indent(out) << "    return lastComparison;" << endl;
     indent(out) << "  }" << endl;