1 Star 0 Fork 16

yaokai13/thrift

forked from src-openEuler/thrift 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
THRIFT-4177.patch 1.43 KB
一键复制 编辑 原始数据 按行查看 历史
yaokai13 提交于 2020-08-18 17:36 +08:00 . package init
diff --git a/compiler/cpp/src/thrift/generate/t_java_generator.cc b/compiler/cpp/src/thrift/generate/t_java_generator.cc
index fb581e4..90dfa06 100644
--- a/compiler/cpp/src/thrift/generate/t_java_generator.cc
+++ b/compiler/cpp/src/thrift/generate/t_java_generator.cc
@@ -4657,8 +4657,9 @@ void t_java_generator::generate_deep_copy_non_container(ofstream& out,
std::string dest_name,
t_type* type) {
(void)dest_name;
+ type = get_true_type(type);
if (type->is_base_type() || type->is_enum() || type->is_typedef()) {
- if (((t_base_type*)type)->is_binary()) {
+ if (type->is_binary()) {
out << "org.apache.thrift.TBaseHelper.copyBinary(" << source_name << ")";
} else {
// everything else can be copied directly
diff --git a/compiler/cpp/src/thrift/parse/t_type.h b/compiler/cpp/src/thrift/parse/t_type.h
index 30f8c1f7..3a6d1e04 100644
--- a/compiler/cpp/src/thrift/parse/t_type.h
+++ b/compiler/cpp/src/thrift/parse/t_type.h
@@ -47,6 +47,7 @@ public:
virtual bool is_void() const { return false; }
virtual bool is_base_type() const { return false; }
virtual bool is_string() const { return false; }
+ virtual bool is_binary() const { return false; }
virtual bool is_bool() const { return false; }
virtual bool is_typedef() const { return false; }
virtual bool is_enum() const { return false; }
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/yaokai13/thrift.git
git@gitee.com:yaokai13/thrift.git
yaokai13
thrift
thrift
master

搜索帮助