string t_java_generator::java_type_imports() {
string hash_builder;
string tree_set_and_map;
- if (gen_hash_code_) {
- hash_builder = "import org.apache.commons.lang3.builder.HashCodeBuilder;\n";
- }
if (sorted_containers_) {
tree_set_and_map = string() +
"import java.util.TreeSet;\n" +
if (gen_hash_code_) {
indent(out) << "@Override" << endl;
indent(out) << "public int hashCode() {" << endl;
- indent(out) << " HashCodeBuilder hcb = new HashCodeBuilder();" << endl;
- indent(out) << " hcb.append(this.getClass().getName());" << endl;
+ indent(out) << " List<Object> list = new ArrayList<Object>();" << endl;
+ indent(out) << " list.add(this.getClass().getName());" << endl;
indent(out) << " org.apache.thrift.TFieldIdEnum setField = getSetField();" << endl;
indent(out) << " if (setField != null) {" << endl;
- indent(out) << " hcb.append(setField.getThriftFieldId());" << endl;
+ indent(out) << " list.add(setField.getThriftFieldId());" << endl;
indent(out) << " Object value = getFieldValue();" << endl;
indent(out) << " if (value instanceof org.apache.thrift.TEnum) {" << endl;
- indent(out) << " hcb.append(((org.apache.thrift.TEnum)getFieldValue()).getValue());" << endl;
+ indent(out) << " list.add(((org.apache.thrift.TEnum)getFieldValue()).getValue());" << endl;
indent(out) << " } else {" << endl;
- indent(out) << " hcb.append(value);" << endl;
+ indent(out) << " list.add(value);" << endl;
indent(out) << " }" << endl;
indent(out) << " }" << endl;
- indent(out) << " return hcb.toHashCode();" << endl;
+ indent(out) << " return list.hashCode();" << endl;
indent(out) << "}";
} else {
indent(out) << "/**" << endl;
indent() << "public int hashCode() {" << endl;
indent_up();
if (gen_hash_code_) {
- indent(out) << "HashCodeBuilder builder = new HashCodeBuilder();" << endl;
+ indent(out) << "List<Object> list = new ArrayList<Object>();" << endl;
for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
out << endl;
}
indent(out) << "boolean present_" << name << " = " << present << ";" << endl;
- indent(out) << "builder.append(present_" << name << ");" << endl;
+ indent(out) << "list.add(present_" << name << ");" << endl;
indent(out) << "if (present_" << name << ")" << endl;
if (t->is_enum()) {
- indent(out) << " builder.append(" << name << ".getValue());" << endl;
+ indent(out) << " list.add(" << name << ".getValue());" << endl;
} else {
- indent(out) << " builder.append(" << name << ");" << endl;
+ indent(out) << " list.add(" << name << ");" << endl;
}
}
out << endl;
- indent(out) << "return builder.toHashCode();" << endl;
+ indent(out) << "return list.hashCode();" << endl;
} else {
indent(out) << "return 0;" << endl;
}
Build-Depends: debhelper (>= 5), build-essential, mono-gmcs, python-dev, ant,
mono-devel, libmono-system-web2.0-cil, erlang-base, ruby1.8-dev, autoconf, python-support,
automake, pkg-config, libtool, bison, flex, libboost-dev | libboost1.40-dev, python-all,
- python-all-dev, python-all-dbg, openjdk-6-jdk | java-sdk, libcommons-lang3-java,
+ python-all-dev, python-all-dbg, openjdk-6-jdk | java-sdk,
libboost-test-dev | libboost-test1.40-dev, libevent-dev, perl (>= 5.8.0-7),
php5, php5-dev, libglib2.0-dev, libqt4-dev
Maintainer: Thrift Developer's <dev@thrift.apache.org>
Architecture: all
Section: libs
Depends: java-gcj-compat | java1-runtime | java2-runtime, ${misc:Depends}
-Recommends: libcommons-lang3-java
Description: Java bindings for Thrift
Thrift is a software framework for scalable cross-language services
development. It combines a software stack with a code generation engine to