mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-08 17:45:24 +02:00
Bug 147792 - patch to put an end to circular searches
This commit is contained in:
parent
b761dbbd49
commit
5272f66d8d
3 changed files with 38 additions and 6 deletions
|
@ -145,9 +145,18 @@ public class UniversalSearchHandler extends Thread implements ICancellableHandle
|
|||
_isCancelled = true;
|
||||
}
|
||||
|
||||
protected boolean hasSearchedDirectory(File file) {
|
||||
protected boolean hasSearchedDirectory(File file)
|
||||
{
|
||||
try
|
||||
{
|
||||
return _alreadySearched.contains(file.getCanonicalFile());
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
_dataStore.trace(e);
|
||||
return _alreadySearched.contains(file);
|
||||
}
|
||||
}
|
||||
|
||||
protected void internalSearch(File theFile, int depth) {
|
||||
|
||||
|
@ -256,7 +265,15 @@ public class UniversalSearchHandler extends Thread implements ICancellableHandle
|
|||
|
||||
if (!hasSearchedDirectory(theFile)) {
|
||||
|
||||
try
|
||||
{
|
||||
_alreadySearched.add(theFile.getCanonicalFile());
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
_dataStore.trace(e);
|
||||
_alreadySearched.add(theFile);
|
||||
}
|
||||
|
||||
File[] children = null;
|
||||
|
||||
|
|
|
@ -173,9 +173,16 @@ public class LocalSearchHandler implements ISearchHandler
|
|||
}
|
||||
|
||||
private boolean hasSearchedDirectory(File file)
|
||||
{
|
||||
try
|
||||
{
|
||||
return _alreadySearched.contains(file.getCanonicalFile());
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
return _alreadySearched.contains(file);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean internalSearch(File theFile, int depth, IHostFile context)
|
||||
{
|
||||
|
@ -306,7 +313,14 @@ public class LocalSearchHandler implements ISearchHandler
|
|||
if (!hasSearchedDirectory(theFile))
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
_alreadySearched.add(theFile.getCanonicalFile());
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
_alreadySearched.add(theFile);
|
||||
}
|
||||
|
||||
File[] children = null;
|
||||
|
||||
|
|
|
@ -979,7 +979,8 @@ public abstract class RemoteFileSubSystem extends SubSystem implements IRemoteFi
|
|||
for (int i = 0; i < folderOrFileNames.size(); i++)
|
||||
{
|
||||
String path = (String)folderOrFileNames.get(i);
|
||||
results.addResource(getRemoteFileObject(path));
|
||||
IRemoteFile nextFile = getRemoteFileObject(path);
|
||||
if (nextFile != null) results.addResource(nextFile);
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue