THRIFT-2162 Missing calls to inherited CTOR at misc. places

Patch: Jens Geyer
This commit is contained in:
Jens Geyer 2013-09-06 21:02:34 +02:00
parent a6a32a56fb
commit 718f6eefb6
10 changed files with 45 additions and 11 deletions

View File

@ -1441,6 +1441,7 @@ void t_delphi_generator::generate_service_client(t_service* tservice) {
".TClient.Create( const iprot: IProtocol; const oprot: IProtocol);" << endl;
indent_impl(s_service_impl) << "begin" << endl;
indent_up_impl();
indent_impl(s_service_impl) << "inherited Create;" << endl;
indent_impl(s_service_impl) << "iprot_ := iprot;" << endl;
indent_impl(s_service_impl) << "oprot_ := oprot;" << endl;
indent_down_impl();

View File

@ -320,6 +320,7 @@ end;
constructor TThriftDictionaryImpl<TKey, TValue>.Create(ACapacity: Integer);
begin
inherited Create;
FDictionaly := TDictionary<TKey,TValue>.Create( ACapacity );
end;
@ -449,6 +450,7 @@ end;
constructor TThriftListImpl<T>.Create;
begin
inherited;
FList := TList<T>.Create;
end;

View File

@ -84,6 +84,7 @@ end;
constructor TGUIConsole.Create( AMemo: TMemo);
begin
inherited Create;
FMemo := AMemo;
FLineBreak := True;
end;

View File

@ -516,6 +516,7 @@ end;
constructor TFieldImpl.Create(const AName: string; const AType: TType;
AId: SmallInt);
begin
inherited Create;
FName := AName;
FType := AType;
FId := AId;
@ -523,6 +524,7 @@ end;
constructor TFieldImpl.Create;
begin
inherited Create;
FName := '';
FType := Low(TType);
FId := 0;
@ -702,7 +704,7 @@ end;
constructor TMapImpl.Create;
begin
inherited Create;
end;
function TMapImpl.GetCount: Integer;
@ -792,7 +794,7 @@ end;
constructor TSetImpl.Create;
begin
inherited Create;
end;
function TSetImpl.GetCount: Integer;
@ -826,7 +828,7 @@ end;
constructor TListImpl.Create;
begin
inherited Create;
end;
function TListImpl.GetCount: Integer;
@ -853,6 +855,7 @@ end;
constructor TBinaryProtocolImpl.Create( const trans: ITransport);
begin
//no inherited
Create( trans, False, True);
end;
@ -1253,12 +1256,14 @@ end;
constructor TBinaryProtocolImpl.TFactory.Create(AStrictRead, AStrictWrite: Boolean);
begin
inherited Create;
FStrictRead := AStrictRead;
FStrictWrite := AStrictWrite;
end;
constructor TBinaryProtocolImpl.TFactory.Create;
begin
//no inherited;
Create( False, True )
end;

View File

@ -86,6 +86,7 @@ implementation
constructor TSerializer.Create();
// Create a new TSerializer that uses the TBinaryProtocol by default.
begin
//no inherited;
Create( TBinaryProtocolImpl.TFactory.Create);
end;
@ -156,6 +157,7 @@ end;
constructor TDeserializer.Create();
// Create a new TDeserializer that uses the TBinaryProtocol by default.
begin
//no inherited;
Create( TBinaryProtocolImpl.TFactory.Create);
end;

View File

@ -120,6 +120,7 @@ begin
InputTransFactory := TTransportFactoryImpl.Create;
OutputTransFactory := TTransportFactoryImpl.Create;
//no inherited;
Create(
AProcessor,
AServerTransport,
@ -143,6 +144,7 @@ begin
InputTransFactory := TTransportFactoryImpl.Create;
OutputTransFactory := TTransportFactoryImpl.Create;
//no inherited;
Create(
AProcessor,
AServerTransport,
@ -163,6 +165,7 @@ begin
InputProtocolFactory := TBinaryProtocolImpl.TFactory.Create;
OutputProtocolFactory := TBinaryProtocolImpl.TFactory.Create;
//no inherited;
Create( AProcessor, AServerTransport, ATransportFactory, ATransportFactory,
InputProtocolFactory, OutputProtocolFactory, DefaultLogDelegate);
end;
@ -173,6 +176,7 @@ constructor TServerImpl.Create(const AProcessor: IProcessor;
const AInputProtocolFactory, AOutputProtocolFactory: IProtocolFactory;
const ALogDelegate : TLogDelegate);
begin
inherited Create;
FProcessor := AProcessor;
FServerTransport := AServerTransport;
FInputTransportFactory := AInputTransportFactory;
@ -191,6 +195,7 @@ constructor TServerImpl.Create( const AProcessor: IProcessor;
const AServerTransport: IServerTransport; const ATransportFactory: ITransportFactory;
const AProtocolFactory: IProtocolFactory);
begin
//no inherited;
Create( AProcessor, AServerTransport,
ATransportFactory, ATransportFactory,
AProtocolFactory, AProtocolFactory,

View File

@ -98,6 +98,7 @@ end;
constructor TThriftStreamAdapterCOM.Create( const AStream: IStream);
begin
inherited Create;
FStream := AStream;
end;
@ -221,6 +222,7 @@ end;
constructor TThriftStreamAdapterDelphi.Create( const AStream: TStream; AOwnsStream: Boolean);
begin
inherited Create;
FStream := AStream;
FOwnsStream := AOwnsStream;
end;

View File

@ -502,6 +502,7 @@ end;
constructor TTransportException.Create(AType: TExceptionType);
begin
//no inherited;
Create( AType, '' )
end;
@ -539,17 +540,20 @@ end;
constructor TServerSocketImpl.Create( const AServer: TTcpServer; AClientTimeout: Integer);
begin
inherited Create;
FServer := AServer;
FClientTimeout := AClientTimeout;
end;
constructor TServerSocketImpl.Create( const AServer: TTcpServer);
begin
//no inherited;
Create( AServer, 0 );
end;
constructor TServerSocketImpl.Create(APort: Integer);
begin
//no inherited;
Create( APort, 0 );
end;
@ -616,6 +620,7 @@ end;
constructor TServerSocketImpl.Create(APort, AClientTimeout: Integer;
AUseBufferedSockets: Boolean);
begin
inherited Create;
FPort := APort;
FClientTimeout := AClientTimeout;
FUseBufferedSocket := AUseBufferedSockets;
@ -655,6 +660,7 @@ end;
constructor TServerSocketImpl.Create(APort, AClientTimeout: Integer);
begin
//no inherited;
Create( APort, AClientTimeout, False );
end;
@ -666,27 +672,25 @@ var
begin
FClient := AClient;
stream := TTcpSocketStreamImpl.Create( FClient);
FInputStream := stream;
FOutputStream := stream;
inherited Create( stream, stream);
end;
constructor TSocketImpl.Create(const AHost: string; APort: Integer);
begin
//no inherited;
Create( AHost, APort, 0);
end;
procedure TSocketImpl.Close;
begin
inherited Close;
if FClient <> nil then
begin
FClient.Free;
FClient := nil;
end;
if FClient <> nil
then FreeAndNil( FClient);
end;
constructor TSocketImpl.Create(const AHost: string; APort, ATimeout: Integer);
begin
inherited Create(nil,nil);
FHost := AHost;
FPort := APort;
FTimeout := ATimeout;
@ -781,6 +785,7 @@ end;
constructor TBufferedStreamImpl.Create( const AStream: IThriftStream; ABufSize: Integer);
begin
inherited Create;
FStream := AStream;
FBufSize := ABufSize;
FReadBuffer := TMemoryStream.Create;
@ -916,6 +921,7 @@ end;
constructor TStreamTransportImpl.Create( const AInputStream : IThriftStream; const AOutputStream : IThriftStream);
begin
inherited Create;
FInputStream := AInputStream;
FOutputStream := AOutputStream;
end;
@ -980,6 +986,7 @@ end;
constructor TBufferedTransportImpl.Create( const ATransport: IStreamTransport);
begin
//no inherited;
Create( ATransport, 1024 );
end;
@ -991,6 +998,7 @@ end;
constructor TBufferedTransportImpl.Create( const ATransport: IStreamTransport;
ABufSize: Integer);
begin
inherited Create;
FTransport := ATransport;
FBufSize := ABufSize;
InitBuffers;
@ -1067,6 +1075,7 @@ end;
constructor TFramedTransportImpl.Create;
begin
inherited Create;
InitWriteBuffer;
end;
@ -1077,6 +1086,7 @@ end;
constructor TFramedTransportImpl.Create( const ATrans: ITransport);
begin
inherited Create;
InitWriteBuffer;
FTransport := ATrans;
end;
@ -1206,6 +1216,7 @@ end;
constructor TTcpSocketStreamImpl.Create( const ATcpClient: TCustomIpClient);
begin
inherited Create;
FTcpClient := ATcpClient;
end;

View File

@ -66,7 +66,9 @@ type
procedure ClientTest;
procedure JSONProtocolReadWriteTest;
{$IFDEF StressTest}
procedure StressTest(const client : TThriftTest.Iface);
{$ENDIF}
protected
procedure Execute; override;
public
@ -859,6 +861,7 @@ begin
end;
{$IFDEF StressTest}
procedure TClientThread.StressTest(const client : TThriftTest.Iface);
begin
while TRUE do begin
@ -875,7 +878,7 @@ begin
end;
end;
end;
{$ENDIF}
procedure TClientThread.JSONProtocolReadWriteTest;
// Tests only then read/write procedures of the JSON protocol
@ -1080,6 +1083,7 @@ end;
constructor TThreadConsole.Create(AThread: TThread);
begin
inherited Create;
FThread := AThread;
end;

View File

@ -78,6 +78,7 @@ end;
constructor TTestClient.Create( const args: array of string);
begin
inherited;
ParseArgs(args);
Setup;
end;