Converter + codetools: try to find out why FInterfaceIdentifierCache is Nil sometimes in TFindDeclarationTool.FindIdentifierInInterface.

git-svn-id: trunk@41712 -
This commit is contained in:
juha 2013-06-14 13:45:12 +00:00
parent 70e441594c
commit 673142547e
3 changed files with 13 additions and 0 deletions

View File

@ -6331,6 +6331,8 @@ begin
AVLNode:=FInterfaceIdentifierCache.Items.FindSuccessor(AVLNode); AVLNode:=FInterfaceIdentifierCache.Items.FindSuccessor(AVLNode);
end; end;
end else begin end else begin
Assert(Assigned(FInterfaceIdentifierCache),
'TFindDeclarationTool.FindIdentifierInInterface: FInterfaceIdentifierCache is not assigned');
CacheEntry:=FInterfaceIdentifierCache.FindIdentifier(Params.Identifier); CacheEntry:=FInterfaceIdentifierCache.FindIdentifier(Params.Identifier);
if CacheEntry=nil then if CacheEntry=nil then
exit(false); exit(false);

View File

@ -1066,6 +1066,8 @@ begin
if not fSettings.SameDfmFile then begin if not fSettings.SameDfmFile then begin
fSettings.AddLogLine(''); fSettings.AddLogLine('');
fSettings.AddLogLine(lisConvDelphiRepairingFormFiles); fSettings.AddLogLine(lisConvDelphiRepairingFormFiles);
DebugLn('');
DebugLn('TConvertDelphiProjPack.ConvertAllFormFiles: '+lisConvDelphiRepairingFormFiles);
end; end;
Screen.Cursor:=crHourGlass; Screen.Cursor:=crHourGlass;
try try
@ -1577,6 +1579,8 @@ begin
try try
fSettings.AddLogLine(''); fSettings.AddLogLine('');
fSettings.AddLogLine(lisConvDelphiFindAllUnitFiles); fSettings.AddLogLine(lisConvDelphiFindAllUnitFiles);
DebugLn('');
DebugLn('TConvertDelphiProject.FindAllUnits: '+lisConvDelphiFindAllUnitFiles);
if not CodeToolBoss.FindDelphiProjectUnits(fMainUnitConverter.fPascalBuffer, if not CodeToolBoss.FindDelphiProjectUnits(fMainUnitConverter.fPascalBuffer,
FoundUnits, MisUnits, NormalUnits) then FoundUnits, MisUnits, NormalUnits) then
begin begin
@ -1918,6 +1922,10 @@ begin
MisUnits:=nil; MisUnits:=nil;
NormalUnits:=nil; NormalUnits:=nil;
try try
fSettings.AddLogLine('');
fSettings.AddLogLine(lisConvDelphiFindAllUnitFiles);
DebugLn('');
DebugLn('TConvertDelphiPackage.FindAllUnits: '+lisConvDelphiFindAllUnitFiles);
if not CodeToolBoss.FindDelphiPackageUnits(fMainUnitConverter.fPascalBuffer, if not CodeToolBoss.FindDelphiPackageUnits(fMainUnitConverter.fPascalBuffer,
FoundUnits, MisUnits, NormalUnits) then FoundUnits, MisUnits, NormalUnits) then
begin begin

View File

@ -527,6 +527,7 @@ begin
LoopCount:=0; // Prevent possible eternal loops with a counter LoopCount:=0; // Prevent possible eternal loops with a counter
repeat repeat
repeat repeat
DebugLn('TLFMFixer.ConvertAndRepair: Checking LFM for '+fPascalBuffer.Filename);
if not fLFMTree.ParseIfNeeded then exit; if not fLFMTree.ParseIfNeeded then exit;
if CodeToolBoss.CheckLFM(fPascalBuffer, fLFMBuffer, fLFMTree, if CodeToolBoss.CheckLFM(fPascalBuffer, fLFMBuffer, fLFMTree,
fRootMustBeClassInUnit, fRootMustBeClassInIntf, fObjectsMustExist) then fRootMustBeClassInUnit, fRootMustBeClassInIntf, fObjectsMustExist) then
@ -544,6 +545,8 @@ begin
Result:=mrOk Result:=mrOk
else begin else begin
Result:=FindAndFixMissingComponentClasses; // Can return mrRetry. Result:=FindAndFixMissingComponentClasses; // Can return mrRetry.
if Result=mrRetry then
DebugLn('TLFMFixer.ConvertAndRepair: Added unit to uses section -> another loop');
end; end;
Inc(LoopCount); // Increment also in outer loop Inc(LoopCount); // Increment also in outer loop
until (Result in [mrOK, mrAbort]) or (LoopCount>MaxLoopCount); until (Result in [mrOK, mrAbort]) or (LoopCount>MaxLoopCount);