Author: bryanduxbury
Date: Mon Sep 21 16:52:48 2009
New Revision: 817317

URL: http://svn.apache.org/viewvc?rev=817317&view=rev
Log:
THRIFT-572. java: Union compareTo is broken

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=817317&r1=817316&r2=817317&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 Mon 
Sep 21 16:52:48 2009
@@ -960,7 +960,7 @@
     indent(out) << "@Override" << endl;
     indent(out) << "public int compareTo(" << type_name(tstruct) << " other) 
{" << endl;
     indent(out) << "  int lastComparison = 
TBaseHelper.compareTo(getSetField(), other.getSetField());" << endl;
-    indent(out) << "  if (lastComparison != 0) {" << endl;
+    indent(out) << "  if (lastComparison == 0) {" << endl;
     indent(out) << "    return 
TBaseHelper.compareTo((Comparable)getFieldValue(), 
(Comparable)other.getFieldValue());" << endl;
     indent(out) << "  }" << endl;
     indent(out) << "  return lastComparison;" << endl;


Reply via email to