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 2015/06/29 11:32:30 UTC

thrift git commit: THRIFT-3210 (uncompileable) code generated for server events while are events not enabled Client: Delphi Patch: Jens Geyer

Repository: thrift
Updated Branches:
  refs/heads/master 9d803f512 -> 507075607


THRIFT-3210 (uncompileable) code generated for server events while are events not enabled
Client: Delphi
Patch: Jens Geyer


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

Branch: refs/heads/master
Commit: 507075607f511215cf9c403ff722202c1075dcef
Parents: 9d803f5
Author: Jens Geyer <je...@apache.org>
Authored: Mon Jun 29 11:30:40 2015 +0200
Committer: Jens Geyer <je...@apache.org>
Committed: Mon Jun 29 11:30:40 2015 +0200

----------------------------------------------------------------------
 compiler/cpp/src/generate/t_delphi_generator.cc | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/thrift/blob/50707560/compiler/cpp/src/generate/t_delphi_generator.cc
----------------------------------------------------------------------
diff --git a/compiler/cpp/src/generate/t_delphi_generator.cc b/compiler/cpp/src/generate/t_delphi_generator.cc
index 2684811..71c49d3 100644
--- a/compiler/cpp/src/generate/t_delphi_generator.cc
+++ b/compiler/cpp/src/generate/t_delphi_generator.cc
@@ -2430,14 +2430,18 @@ void t_delphi_generator::generate_process_function(t_service* tservice, t_functi
 
   indent_impl(s_service_impl) << "on E: Exception do begin" << endl;
   indent_up_impl();
-  indent_impl(s_service_impl) << "if events <> nil then events.UnhandledError(E);" << endl;
+  if(events_) {
+    indent_impl(s_service_impl) << "if events <> nil then events.UnhandledError(E);" << endl;
+  }
   if (!tfunction->is_oneway()) {
     indent_impl(s_service_impl) << "appx := TApplicationException.Create( "
                                    "TApplicationException.TExceptionType.InternalError, E.Message);"
                                 << endl;
     indent_impl(s_service_impl) << "try" << endl;
     indent_up_impl();
-    indent_impl(s_service_impl) << "if events <> nil then events.PreWrite;" << endl;
+    if(events_) {
+      indent_impl(s_service_impl) << "if events <> nil then events.PreWrite;" << endl;
+    }
     indent_impl(s_service_impl) << "msg := Thrift.Protocol.TMessageImpl.Create('"
                                 << tfunction->get_name() << "', TMessageType.Exception, seqid);"
                                 << endl;
@@ -2445,8 +2449,10 @@ void t_delphi_generator::generate_process_function(t_service* tservice, t_functi
     indent_impl(s_service_impl) << "appx.Write(oprot);" << endl;
     indent_impl(s_service_impl) << "oprot.WriteMessageEnd();" << endl;
     indent_impl(s_service_impl) << "oprot.Transport.Flush();" << endl;
-    indent_impl(s_service_impl) << "if events <> nil then events.PostWrite;" << endl;
-    indent_impl(s_service_impl) << "Exit;" << endl;
+    if(events_) {
+      indent_impl(s_service_impl) << "if events <> nil then events.PostWrite;" << endl;
+    }
+	indent_impl(s_service_impl) << "Exit;" << endl;
     indent_down_impl();
     indent_impl(s_service_impl) << "finally" << endl;
     indent_up_impl();