1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-06 07:45:50 +02:00

[277911] cached results of remote file query need to be sorted

This commit is contained in:
David McKnight 2009-05-29 14:12:25 +00:00
parent 837b060804
commit 2f85b3ea6e

View file

@ -20,12 +20,14 @@
* Martin Oberhuber (Wind River) - [220020][api][breaking] SystemFileTransferModeRegistry should be internal
* 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) - [277911] cached results of remote file query need to be sorted
*******************************************************************************/
package org.eclipse.rse.subsystems.files.core.subsystems;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Date;
import java.util.HashMap;
@ -678,7 +680,7 @@ public abstract class RemoteFile implements IRemoteFile, IAdaptable, Comparable
public Object[] getContents(ISystemContentsType contentsType, String filter)
{
HashMap filters = (HashMap)(_contents.get(contentsType));
Object[] results = null;
if (filters == null || filters.isEmpty())
{
if (contentsType == RemoteChildrenContentsType.getInstance())
@ -715,22 +717,11 @@ public abstract class RemoteFile implements IRemoteFile, IAdaptable, Comparable
filter = "*"; //$NON-NLS-1$
}
if (filters.containsKey(filter))
{
if (filters.containsKey(filter)){
Object[] filterResults = (Object[])filters.get(filter);
if (contentsType == RemoteChildrenContentsType.getInstance() ||
contentsType == RemoteFileChildrenContentsType.getInstance() ||
contentsType == RemoteFolderChildrenContentsType.getInstance()
)
{
return filterResults;
results = filterResults;
}
else
{
return filterResults;
}
}
else {
ArrayList calculatedResults = new ArrayList();
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;
}
/**