mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-07 16:26:11 +02:00
[277911] cached results of remote file query need to be sorted
This commit is contained in:
parent
837b060804
commit
2f85b3ea6e
1 changed files with 56 additions and 62 deletions
|
@ -20,12 +20,14 @@
|
||||||
* Martin Oberhuber (Wind River) - [220020][api][breaking] SystemFileTransferModeRegistry should be internal
|
* Martin Oberhuber (Wind River) - [220020][api][breaking] SystemFileTransferModeRegistry should be internal
|
||||||
* Martin Oberhuber (Wind River) - [219975] Fix implementations of clone()
|
* Martin Oberhuber (Wind River) - [219975] Fix implementations of clone()
|
||||||
* David McKnight (IBM) - [231209] [api][breaking] IRemoteFile.getSystemConnection() should be changed to IRemoteFile.getHost()
|
* David McKnight (IBM) - [231209] [api][breaking] IRemoteFile.getSystemConnection() should be changed to IRemoteFile.getHost()
|
||||||
|
* David McKnight (IBM) - [277911] cached results of remote file query need to be sorted
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.rse.subsystems.files.core.subsystems;
|
package org.eclipse.rse.subsystems.files.core.subsystems;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
@ -678,7 +680,7 @@ public abstract class RemoteFile implements IRemoteFile, IAdaptable, Comparable
|
||||||
public Object[] getContents(ISystemContentsType contentsType, String filter)
|
public Object[] getContents(ISystemContentsType contentsType, String filter)
|
||||||
{
|
{
|
||||||
HashMap filters = (HashMap)(_contents.get(contentsType));
|
HashMap filters = (HashMap)(_contents.get(contentsType));
|
||||||
|
Object[] results = null;
|
||||||
if (filters == null || filters.isEmpty())
|
if (filters == null || filters.isEmpty())
|
||||||
{
|
{
|
||||||
if (contentsType == RemoteChildrenContentsType.getInstance())
|
if (contentsType == RemoteChildrenContentsType.getInstance())
|
||||||
|
@ -715,22 +717,11 @@ public abstract class RemoteFile implements IRemoteFile, IAdaptable, Comparable
|
||||||
filter = "*"; //$NON-NLS-1$
|
filter = "*"; //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
if (filters.containsKey(filter))
|
if (filters.containsKey(filter)){
|
||||||
{
|
|
||||||
Object[] filterResults = (Object[])filters.get(filter);
|
Object[] filterResults = (Object[])filters.get(filter);
|
||||||
if (contentsType == RemoteChildrenContentsType.getInstance() ||
|
results = filterResults;
|
||||||
contentsType == RemoteFileChildrenContentsType.getInstance() ||
|
|
||||||
contentsType == RemoteFolderChildrenContentsType.getInstance()
|
|
||||||
)
|
|
||||||
{
|
|
||||||
return filterResults;
|
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
return filterResults;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ArrayList calculatedResults = new ArrayList();
|
ArrayList calculatedResults = new ArrayList();
|
||||||
|
|
||||||
StringComparePatternMatcher fmatcher = new StringComparePatternMatcher(filter);
|
StringComparePatternMatcher fmatcher = new StringComparePatternMatcher(filter);
|
||||||
|
@ -790,8 +781,11 @@ public abstract class RemoteFile implements IRemoteFile, IAdaptable, Comparable
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
results = calculatedResults.toArray();
|
||||||
|
}
|
||||||
|
|
||||||
return calculatedResults.toArray();
|
Arrays.sort(results);
|
||||||
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue