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 2020/02/14 08:16:20 UTC

[thrift] branch master updated: THRIFT-5091 Netstd generator produces uncompileable code for struct names ending with "_result" or "_args" Client: netstd Patch: Jens Geyer

This is an automated email from the ASF dual-hosted git repository.

jensg pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/thrift.git


The following commit(s) were added to refs/heads/master by this push:
     new bb5f7ec  THRIFT-5091 Netstd generator produces uncompileable code for struct names ending with "_result" or "_args" Client: netstd Patch: Jens Geyer
bb5f7ec is described below

commit bb5f7ec6b06220808cd20c8488fe8f90a54f3929
Author: Jens Geyer <je...@apache.org>
AuthorDate: Thu Feb 13 22:35:28 2020 +0100

    THRIFT-5091 Netstd generator produces uncompileable code for struct names ending with "_result" or "_args"
    Client: netstd
    Patch: Jens Geyer
    
    THis closes #2006
---
 compiler/cpp/src/thrift/generate/t_netstd_generator.cc | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/compiler/cpp/src/thrift/generate/t_netstd_generator.cc b/compiler/cpp/src/thrift/generate/t_netstd_generator.cc
index ba55960..cc6287d 100644
--- a/compiler/cpp/src/thrift/generate/t_netstd_generator.cc
+++ b/compiler/cpp/src/thrift/generate/t_netstd_generator.cc
@@ -2746,17 +2746,19 @@ string t_netstd_generator::type_name(t_type* ttype)
         return "List<" + type_name(tlist->get_elem_type()) + ">";
     }
 
+    string the_name = check_and_correct_struct_name(normalize_name(ttype->get_name()));
+
     t_program* program = ttype->get_program();
     if (program != NULL && program != program_)
     {
         string ns = program->get_namespace("netstd");
         if (!ns.empty())
         {
-            return ns + "." + normalize_name(ttype->get_name());
+            return ns + "." + the_name;
         }
     }
 
-    return normalize_name(ttype->get_name());
+    return the_name;
 }
 
 string t_netstd_generator::base_type_name(t_base_type* tbase)