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,8 +145,17 @@ public class UniversalSearchHandler extends Thread implements ICancellableHandle
|
||||||
_isCancelled = true;
|
_isCancelled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean hasSearchedDirectory(File file) {
|
protected boolean hasSearchedDirectory(File file)
|
||||||
return _alreadySearched.contains(file);
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
return _alreadySearched.contains(file.getCanonicalFile());
|
||||||
|
}
|
||||||
|
catch (IOException e)
|
||||||
|
{
|
||||||
|
_dataStore.trace(e);
|
||||||
|
return _alreadySearched.contains(file);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void internalSearch(File theFile, int depth) {
|
protected void internalSearch(File theFile, int depth) {
|
||||||
|
@ -256,7 +265,15 @@ public class UniversalSearchHandler extends Thread implements ICancellableHandle
|
||||||
|
|
||||||
if (!hasSearchedDirectory(theFile)) {
|
if (!hasSearchedDirectory(theFile)) {
|
||||||
|
|
||||||
_alreadySearched.add(theFile);
|
try
|
||||||
|
{
|
||||||
|
_alreadySearched.add(theFile.getCanonicalFile());
|
||||||
|
}
|
||||||
|
catch (IOException e)
|
||||||
|
{
|
||||||
|
_dataStore.trace(e);
|
||||||
|
_alreadySearched.add(theFile);
|
||||||
|
}
|
||||||
|
|
||||||
File[] children = null;
|
File[] children = null;
|
||||||
|
|
||||||
|
|
|
@ -174,7 +174,14 @@ public class LocalSearchHandler implements ISearchHandler
|
||||||
|
|
||||||
private boolean hasSearchedDirectory(File file)
|
private boolean hasSearchedDirectory(File file)
|
||||||
{
|
{
|
||||||
return _alreadySearched.contains(file);
|
try
|
||||||
|
{
|
||||||
|
return _alreadySearched.contains(file.getCanonicalFile());
|
||||||
|
}
|
||||||
|
catch (IOException e)
|
||||||
|
{
|
||||||
|
return _alreadySearched.contains(file);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean internalSearch(File theFile, int depth, IHostFile context)
|
private boolean internalSearch(File theFile, int depth, IHostFile context)
|
||||||
|
@ -306,7 +313,14 @@ public class LocalSearchHandler implements ISearchHandler
|
||||||
if (!hasSearchedDirectory(theFile))
|
if (!hasSearchedDirectory(theFile))
|
||||||
{
|
{
|
||||||
|
|
||||||
_alreadySearched.add(theFile);
|
try
|
||||||
|
{
|
||||||
|
_alreadySearched.add(theFile.getCanonicalFile());
|
||||||
|
}
|
||||||
|
catch (IOException e)
|
||||||
|
{
|
||||||
|
_alreadySearched.add(theFile);
|
||||||
|
}
|
||||||
|
|
||||||
File[] children = null;
|
File[] children = null;
|
||||||
|
|
||||||
|
|
|
@ -979,7 +979,8 @@ public abstract class RemoteFileSubSystem extends SubSystem implements IRemoteFi
|
||||||
for (int i = 0; i < folderOrFileNames.size(); i++)
|
for (int i = 0; i < folderOrFileNames.size(); i++)
|
||||||
{
|
{
|
||||||
String path = (String)folderOrFileNames.get(i);
|
String path = (String)folderOrFileNames.get(i);
|
||||||
results.addResource(getRemoteFileObject(path));
|
IRemoteFile nextFile = getRemoteFileObject(path);
|
||||||
|
if (nextFile != null) results.addResource(nextFile);
|
||||||
}
|
}
|
||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue