You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by jf...@apache.org on 2011/10/26 04:25:07 UTC

svn commit: r1189005 - in /thrift/trunk: compiler/cpp/src/generate/t_delphi_generator.cc lib/delphi/src/Thrift.Transport.pas

Author: jfarrell
Date: Wed Oct 26 02:25:07 2011
New Revision: 1189005

URL: http://svn.apache.org/viewvc?rev=1189005&view=rev
Log:
THRIFT-1404: Delphi compiler generates struct reader code with problem.
Client: delphi
Patch: Kenjiro Fukumitsu

After recieved STOP,it calls additional ReadFieldEnd, which is different from the implementation of other language compiler.


Modified:
    thrift/trunk/compiler/cpp/src/generate/t_delphi_generator.cc
    thrift/trunk/lib/delphi/src/Thrift.Transport.pas

Modified: thrift/trunk/compiler/cpp/src/generate/t_delphi_generator.cc
URL: http://svn.apache.org/viewvc/thrift/trunk/compiler/cpp/src/generate/t_delphi_generator.cc?rev=1189005&r1=1189004&r2=1189005&view=diff
==============================================================================
--- thrift/trunk/compiler/cpp/src/generate/t_delphi_generator.cc (original)
+++ thrift/trunk/compiler/cpp/src/generate/t_delphi_generator.cc Wed Oct 26 02:25:07 2011
@@ -2372,13 +2372,10 @@ void t_delphi_generator::generate_delphi
 
   indent_impl(code_block) << "field_ := iprot.ReadFieldBegin();" << endl;
 
-  indent_impl(code_block) << "try" << endl;
-  indent_up_impl();
-
   indent_impl(code_block) << "if (field_.Type_ = TType.Stop) then" << endl;
   indent_impl(code_block) << "begin" << endl;
   indent_up_impl();
-  indent_impl(code_block) << "break;" << endl;
+  indent_impl(code_block) << "Break;" << endl;
   indent_down_impl();
   indent_impl(code_block) << "end;" << endl;
 
@@ -2432,14 +2429,7 @@ void t_delphi_generator::generate_delphi
     indent_impl(code_block) << "end;" << endl;
   }
 
-
-  indent_down_impl();
-
-  indent_impl(code_block) << "finally" << endl;
-  indent_up_impl();
   indent_impl(code_block) << "iprot.ReadFieldEnd;" << endl;
-  indent_down_impl();
-  indent_impl(code_block) << "end;" << endl;
 
   indent_down_impl();
 

Modified: thrift/trunk/lib/delphi/src/Thrift.Transport.pas
URL: http://svn.apache.org/viewvc/thrift/trunk/lib/delphi/src/Thrift.Transport.pas?rev=1189005&r1=1189004&r2=1189005&view=diff
==============================================================================
--- thrift/trunk/lib/delphi/src/Thrift.Transport.pas (original)
+++ thrift/trunk/lib/delphi/src/Thrift.Transport.pas Wed Oct 26 02:25:07 2011
@@ -959,7 +959,7 @@ procedure TStreamTransportImpl.Write(con
 begin
   if FOutputStream = nil then
   begin
-    raise TTransportException.Create( TTransportException.TExceptionType.NotOpen, 'Cannot read from null outputstream' );
+    raise TTransportException.Create( TTransportException.TExceptionType.NotOpen, 'Cannot write to null outputstream' );
   end;
 
   FOutputStream.Write( buf, off, len );