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/12/01 21:39:25 UTC

[thrift] branch master updated: THRIFT-5317 netstd compiler does not escape keywords 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 c981cf8  THRIFT-5317 netstd compiler does not escape keywords Client: netstd Patch: Jens Geyer
c981cf8 is described below

commit c981cf8891cab7277ddb083282c27549da5a9dda
Author: Jens Geyer <je...@apache.org>
AuthorDate: Tue Dec 1 22:36:31 2020 +0100

    THRIFT-5317 netstd compiler does not escape keywords
    Client: netstd
    Patch: Jens Geyer
---
 compiler/cpp/src/thrift/generate/t_netstd_generator.cc | 4 ++--
 1 file changed, 2 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 8232760..45e658e 100644
--- a/compiler/cpp/src/thrift/generate/t_netstd_generator.cc
+++ b/compiler/cpp/src/thrift/generate/t_netstd_generator.cc
@@ -1066,7 +1066,7 @@ void t_netstd_generator::generate_netstd_struct_definition(ostream& out, t_struc
                 {
                     out << ", ";
                 }
-                out << type_name((*m_iter)->get_type()) << " " << (*m_iter)->get_name();
+                out << type_name((*m_iter)->get_type()) << " " << normalize_name((*m_iter)->get_name());
             }
         }
         out << ") : this()" << endl
@@ -1077,7 +1077,7 @@ void t_netstd_generator::generate_netstd_struct_definition(ostream& out, t_struc
         {
             if (field_is_required(*m_iter))
             {
-                out << indent() << "this." << prop_name(*m_iter) << " = " << (*m_iter)->get_name() << ";" << endl;
+                out << indent() << "this." << prop_name(*m_iter) << " = " << normalize_name((*m_iter)->get_name()) << ";" << endl;
             }
         }