Replace Collections.sort() with direct sort call

Replace existing `Collections.sort(...)` calls with `.sort(...)`
directly on the collection instance.

See gh-9781
This commit is contained in:
Emanuel Campolo
2017-07-18 11:51:31 -03:00
committed by Phillip Webb
parent 04fdec6f8b
commit 4a189bdee7
15 changed files with 16 additions and 20 deletions

View File

@@ -94,9 +94,8 @@ class ServiceCapabilitiesReportGenerator {
private List<Dependency> getSortedDependencies(InitializrServiceMetadata metadata) {
ArrayList<Dependency> dependencies = new ArrayList<>(metadata.getDependencies());
Collections.sort(dependencies, new Comparator<Dependency>() {
@Override
public int compare(Dependency o1, Dependency o2) {
dependencies.sort(new Comparator<Dependency>() {
@Override public int compare(Dependency o1, Dependency o2) {
return o1.getId().compareTo(o2.getId());
}
});

View File

@@ -124,7 +124,7 @@ public class GroovyCompiler {
.load(SpringBootAstTransformation.class)) {
this.transformations.add(transformation);
}
Collections.sort(this.transformations, AnnotationAwareOrderComparator.INSTANCE);
this.transformations.sort(AnnotationAwareOrderComparator.INSTANCE);
}
/**