mirror of
https://github.com/valitydev/thrift.git
synced 2024-11-07 18:58:51 +00:00
THRIFT-572. java: Union compareTo is broken
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@817317 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
3e7fca421e
commit
db40d26f4a
@ -960,7 +960,7 @@ void t_java_generator::generate_union_comparisons(ofstream& out, t_struct* tstru
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user