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/31 15:07:14 UTC
svn commit: r1195461 - in /thrift/trunk:
compiler/cpp/src/generate/t_delphi_generator.cc lib/delphi/src/Thrift.pas
lib/delphi/test/TestServer.pas
Author: jfarrell
Date: Mon Oct 31 14:07:14 2011
New Revision: 1195461
URL: http://svn.apache.org/viewvc?rev=1195461&view=rev
Log:
Thrift-1408: Delphi Test Server: Exception test case fails due to naming conflict with e.message
Client: delphi
Patch: jens Geyer
Fix name comflict with e.message
Modified:
thrift/trunk/compiler/cpp/src/generate/t_delphi_generator.cc
thrift/trunk/lib/delphi/src/Thrift.pas
thrift/trunk/lib/delphi/test/TestServer.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=1195461&r1=1195460&r2=1195461&view=diff
==============================================================================
--- thrift/trunk/compiler/cpp/src/generate/t_delphi_generator.cc (original)
+++ thrift/trunk/compiler/cpp/src/generate/t_delphi_generator.cc Mon Oct 31 14:07:14 2011
@@ -981,7 +981,7 @@ void t_delphi_generator::generate_delphi
}
out << "class(";
if ( is_exception && (! is_x_factory)) {
- out << "Exception";
+ out << "TException";
} else {
out << "TInterfacedObject, IBase, " << struct_intf_name;
}
Modified: thrift/trunk/lib/delphi/src/Thrift.pas
URL: http://svn.apache.org/viewvc/thrift/trunk/lib/delphi/src/Thrift.pas?rev=1195461&r1=1195460&r2=1195461&view=diff
==============================================================================
--- thrift/trunk/lib/delphi/src/Thrift.pas (original)
+++ thrift/trunk/lib/delphi/src/Thrift.pas Mon Oct 31 14:07:14 2011
@@ -54,8 +54,22 @@ type
procedure Write( oprot: IProtocol );
end;
+ // base class for IDL-generated exceptions
+ TException = class( SysUtils.Exception)
+ public
+ procedure Message; // hide inherited property to prevent accidental read/write
+ end;
+
implementation
+{ TException }
+
+procedure TException.Message;
+// hide inherited property to prevent accidental read/write
+begin
+ ASSERT( FALSE, 'Unexpected call to '+ClassName+'.message. Forgot the underscore?');
+end;
+
{ TApplicationException }
constructor TApplicationException.Create;
Modified: thrift/trunk/lib/delphi/test/TestServer.pas
URL: http://svn.apache.org/viewvc/thrift/trunk/lib/delphi/test/TestServer.pas?rev=1195461&r1=1195460&r2=1195461&view=diff
==============================================================================
--- thrift/trunk/lib/delphi/test/TestServer.pas (original)
+++ thrift/trunk/lib/delphi/test/TestServer.pas Mon Oct 31 14:07:14 2011
@@ -276,7 +276,7 @@ begin
begin
x := TXception.Create;
x.ErrorCode := 1001;
- x.Message := 'This is an Xception';
+ x.Message_ := 'This is an Xception';
raise x;
end else
if ( arg0 = 'Xception2') then