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:
committed by
Phillip Webb
parent
04fdec6f8b
commit
4a189bdee7
@@ -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());
|
||||
}
|
||||
});
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user