if (sortSpecList != null) {
FixedSortKeyDefinition[] keys = new FixedSortKeyDefinition[sortSpecList.size()];
for (int i = 0; i < sortSpecList.size(); i++) {
SortSpec spec = (SortSpec) sortSpecList.get(i);
FixedSortKeyDefinition key = new FixedSortKeyDefinition();
key.setSortKey(((SortSpec) sortSpecList.get(i)).sortKey);
key.setOrder(new StringValue(spec.ascending ? "ascending" : "descending"));
key.setEmptyFirst(spec.ascending ? spec.emptyLeast : !spec.emptyLeast);
try {
if (spec.collation != null) {
key.setCollation(env.getCollation(spec.collation));
}
key.bindComparer();
keys[i] = key;
} catch (XPathException e) {
grumble(e.getMessage());
}
}