Skip to content

Commit

Permalink
[BI-1930] Fixed bug with sorting observation variables.
Browse files Browse the repository at this point in the history
  • Loading branch information
davedrp committed Oct 13, 2023
1 parent 84cce7d commit f318dbb
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package org.breedinginsight.brapps.importer.services;

import io.reactivex.functions.Function;
import org.apache.commons.collections4.map.CaseInsensitiveMap;
import org.apache.commons.lang3.tuple.MutablePair;
import org.apache.commons.lang3.tuple.Pair;
import org.breedinginsight.brapps.importer.model.config.MappedImportRelation;
Expand Down Expand Up @@ -76,7 +77,7 @@ public List<Pair<Integer, String>> findFileRelationships(Table data, List<Mapped
}

public <T> List<T> sortByField(List<String> sortedFields, List<T> unsortedItems, Function<T, String> fieldGetter) {
HashMap<String, Integer> sortOrder = new HashMap<>();
CaseInsensitiveMap<String, Integer> sortOrder = new CaseInsensitiveMap<>();
for (int i = 0; i < sortedFields.size(); i++) {
sortOrder.put(sortedFields.get(i), i);
}
Expand Down

0 comments on commit f318dbb

Please sign in to comment.