You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by je...@apache.org on 2017/05/31 20:57:13 UTC

thrift git commit: THRIFT-3703 Unions Field Count Does Not Consider Map/Set/List Fields Client: Go Patch: D. Can Celasun

Repository: thrift
Updated Branches:
  refs/heads/master 197b06299 -> 2b1b32c28


THRIFT-3703 Unions Field Count Does Not Consider Map/Set/List Fields
Client: Go
Patch: D. Can Celasun <ca...@dcc.im>

This closes #1281


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/2b1b32c2
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/2b1b32c2
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/2b1b32c2

Branch: refs/heads/master
Commit: 2b1b32c2836c21ce012d39ebc02c8488d67d4cef
Parents: 197b062
Author: D. Can Celasun <ca...@dcc.im>
Authored: Tue May 30 12:44:56 2017 +0200
Committer: Jens Geyer <je...@apache.org>
Committed: Wed May 31 22:56:52 2017 +0200

----------------------------------------------------------------------
 compiler/cpp/src/thrift/generate/t_go_generator.cc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/thrift/blob/2b1b32c2/compiler/cpp/src/thrift/generate/t_go_generator.cc
----------------------------------------------------------------------
diff --git a/compiler/cpp/src/thrift/generate/t_go_generator.cc b/compiler/cpp/src/thrift/generate/t_go_generator.cc
index c7f5279..8c8bda7 100644
--- a/compiler/cpp/src/thrift/generate/t_go_generator.cc
+++ b/compiler/cpp/src/thrift/generate/t_go_generator.cc
@@ -1445,7 +1445,9 @@ void t_go_generator::generate_countsetfields_helper(ofstream& out,
     if ((*f_iter)->get_req() == t_field::T_REQUIRED)
       continue;
 
-    if (!is_pointer_field(*f_iter))
+    t_type* type = (*f_iter)->get_type()->get_true_type();
+
+    if (!(is_pointer_field(*f_iter) || type->is_map() || type->is_set() || type->is_list()))
       continue;
 
     const string field_name(publicize(escape_string((*f_iter)->get_name())));