summaryrefslogtreecommitdiff
path: root/compiler/cpp
diff options
context:
space:
mode:
authorzeshuai007 <51382517@qq.com>2020-09-16 16:56:51 +0800
committerzeshuai007 <51382517@qq.com>2020-09-16 18:37:40 +0800
commit63213c17ad3fece91fdaaca8f59165ca3f41c5c1 (patch)
treebbc363ae873a334e643ff9bb64863b5d76311b92 /compiler/cpp
parentdd6c8c1069d74f47e81f47dc89285edf906a464e (diff)
downloadthrift-63213c17ad3fece91fdaaca8f59165ca3f41c5c1.tar.gz
Implements TConfiguration for java
Diffstat (limited to 'compiler/cpp')
-rw-r--r--compiler/cpp/src/thrift/generate/t_java_generator.cc15
1 files changed, 7 insertions, 8 deletions
diff --git a/compiler/cpp/src/thrift/generate/t_java_generator.cc b/compiler/cpp/src/thrift/generate/t_java_generator.cc
index 87787025c..ef35f768d 100644
--- a/compiler/cpp/src/thrift/generate/t_java_generator.cc
+++ b/compiler/cpp/src/thrift/generate/t_java_generator.cc
@@ -2526,7 +2526,7 @@ void t_java_generator::generate_java_bean_boilerplate(ostream& out, t_struct* ts
}else{
indent(out) << " : java.nio.ByteBuffer.wrap(" << field_name << ".clone());" << endl;
}
-
+
if (!bean_style_) {
indent(out) << " return this;" << endl;
}
@@ -3861,19 +3861,18 @@ void t_java_generator::generate_deserialize_container(ostream& out,
// Declare variables, read header
if (ttype->is_map()) {
indent(out) << "org.apache.thrift.protocol.TMap " << obj
- << " = new org.apache.thrift.protocol.TMap("
+ << " = iprot.readMapBegin("
<< type_to_enum(((t_map*)ttype)->get_key_type()) << ", "
- << type_to_enum(((t_map*)ttype)->get_val_type()) << ", "
- << "iprot.readI32());" << endl;
+ << type_to_enum(((t_map*)ttype)->get_val_type()) << "); "<< endl;
} else if (ttype->is_set()) {
indent(out) << "org.apache.thrift.protocol.TSet " << obj
- << " = new org.apache.thrift.protocol.TSet("
- << type_to_enum(((t_set*)ttype)->get_elem_type()) << ", iprot.readI32());"
+ << " = iprot.readSetBegin("
+ << type_to_enum(((t_set*)ttype)->get_elem_type()) << ");"
<< endl;
} else if (ttype->is_list()) {
indent(out) << "org.apache.thrift.protocol.TList " << obj
- << " = new org.apache.thrift.protocol.TList("
- << type_to_enum(((t_list*)ttype)->get_elem_type()) << ", iprot.readI32());"
+ << " = iprot.readListBegin("
+ << type_to_enum(((t_list*)ttype)->get_elem_type()) << ");"
<< endl;
}
}