Skip to content
Snippets Groups Projects
Commit b866d350 authored by kaloyane's avatar kaloyane
Browse files

[LMS-2231]: remove redundant sorting (data sets are sorted on the server side)

SVN: 21140
parent 82f7bd3e
No related branches found
No related tags found
No related merge requests found
...@@ -18,7 +18,6 @@ package ch.systemsx.cisd.openbis.dss.generic.server.ftp.resolver; ...@@ -18,7 +18,6 @@ package ch.systemsx.cisd.openbis.dss.generic.server.ftp.resolver;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.Comparator;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
...@@ -298,7 +297,6 @@ public class TemplateBasedDataSetResourceResolver implements IFtpPathResolver, ...@@ -298,7 +297,6 @@ public class TemplateBasedDataSetResourceResolver implements IFtpPathResolver,
private List<EvaluatedDataSetPath> evaluateDataSetPaths(List<ExternalData> dataSets) private List<EvaluatedDataSetPath> evaluateDataSetPaths(List<ExternalData> dataSets)
{ {
List<EvaluatedDataSetPath> result = new ArrayList<EvaluatedDataSetPath>(); List<EvaluatedDataSetPath> result = new ArrayList<EvaluatedDataSetPath>();
sortDataSetsById(dataSets);
for (int disambiguationIdx = 0; disambiguationIdx < dataSets.size(); disambiguationIdx++) for (int disambiguationIdx = 0; disambiguationIdx < dataSets.size(); disambiguationIdx++)
{ {
...@@ -374,30 +372,6 @@ public class TemplateBasedDataSetResourceResolver implements IFtpPathResolver, ...@@ -374,30 +372,6 @@ public class TemplateBasedDataSetResourceResolver implements IFtpPathResolver,
return content.getRootNode(); return content.getRootNode();
} }
private void sortDataSetsById(List<ExternalData> dataSets)
{
Collections.sort(dataSets, new Comparator<ExternalData>()
{
public int compare(ExternalData o1, ExternalData o2)
{
long id1 = o1.getId();
long id2 = o2.getId();
// do not return directly "id1 - id2" to avoid overflow
if (id1 > id2)
{
return 1;
} else if (id1 < id2)
{
return -1;
} else
{
return 0;
}
}
});
}
/** /**
* Given a zero-based disambiguation index, produces the values for * Given a zero-based disambiguation index, produces the values for
* {@value #DISAMBIGUATION_VARNAME}. * {@value #DISAMBIGUATION_VARNAME}.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment