Prefer List.sort(Comparator) over Collections.sort(List, Comparator)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -23,7 +23,6 @@ import java.net.URI;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
@@ -248,7 +247,7 @@ public class VersionResourceResolver extends AbstractResourceResolver {
|
||||
}
|
||||
if (!matchingPatterns.isEmpty()) {
|
||||
Comparator<String> comparator = this.pathMatcher.getPatternComparator(path);
|
||||
Collections.sort(matchingPatterns, comparator);
|
||||
matchingPatterns.sort(comparator);
|
||||
return this.versionStrategyMap.get(matchingPatterns.get(0));
|
||||
}
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user