private void fixOrder(List<OrderingField> orderingFields) {
Collections.reverse(orderingFields);
if (this.currentOrderingFields != null && orderingFields.size() > 1 &&
orderingFields.size() == this.currentOrderingFields.size()) {
for (int i = 1, sortFieldsSize = orderingFields.size(); i < sortFieldsSize; i++) {
OrderingField orderingField = orderingFields.get(i);
OrderingField currentOrderingField = this.currentOrderingFields.get(i);
if (orderingField.getField().equals(currentOrderingField.getField()) &&
orderingField.getOrdering() != currentOrderingField.getOrdering()) {
orderingFields.remove(i);
orderingFields.add(0, orderingField);
}
}
}