Skip to content

Commit

Permalink
Rest: fixed filters execution order to be from lowest to highest rath…
Browse files Browse the repository at this point in the history
…er than the other way around

Closes elastic#7019
  • Loading branch information
javanna committed Jul 28, 2014
1 parent 0e9594e commit 4e5ad56
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main/java/org/elasticsearch/rest/RestController.java
Expand Up @@ -86,7 +86,7 @@ public synchronized void registerFilter(RestFilter preProcessor) {
Arrays.sort(copy, new Comparator<RestFilter>() {
@Override
public int compare(RestFilter o1, RestFilter o2) {
return o2.order() - o1.order();
return Integer.compare(o1.order(), o2.order());
}
});
filters = copy;
Expand Down
Expand Up @@ -60,7 +60,7 @@ public void testRestFilters() throws InterruptedException {
Collections.sort(restFiltersByOrder, new Comparator<RestFilter>() {
@Override
public int compare(RestFilter o1, RestFilter o2) {
return Integer.compare(o2.order(), o1.order());
return Integer.compare(o1.order(), o2.order());
}
});

Expand Down

0 comments on commit 4e5ad56

Please sign in to comment.