Prefer List.sort(Comparator) over Collections.sort(List, Comparator)
This commit is contained in:
@@ -540,7 +540,7 @@ class ConfigurationClassParser {
|
||||
return;
|
||||
}
|
||||
|
||||
Collections.sort(deferredImports, DEFERRED_IMPORT_COMPARATOR);
|
||||
deferredImports.sort(DEFERRED_IMPORT_COMPARATOR);
|
||||
for (DeferredImportSelectorHolder deferredImport : deferredImports) {
|
||||
ConfigurationClass configClass = deferredImport.getConfigurationClass();
|
||||
try {
|
||||
|
||||
@@ -365,7 +365,7 @@ public class DefaultLifecycleProcessor implements LifecycleProcessor, BeanFactor
|
||||
if (logger.isInfoEnabled()) {
|
||||
logger.info("Stopping beans in phase " + this.phase);
|
||||
}
|
||||
Collections.sort(this.members, Collections.reverseOrder());
|
||||
this.members.sort(Collections.reverseOrder());
|
||||
CountDownLatch latch = new CountDownLatch(this.smartMemberCount);
|
||||
Set<String> countDownBeanNames = Collections.synchronizedSet(new LinkedHashSet<>());
|
||||
for (LifecycleGroupMember member : this.members) {
|
||||
|
||||
@@ -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.
|
||||
@@ -260,7 +260,7 @@ class PostProcessorRegistrationDelegate {
|
||||
if (comparatorToUse == null) {
|
||||
comparatorToUse = OrderComparator.INSTANCE;
|
||||
}
|
||||
Collections.sort(postProcessors, comparatorToUse);
|
||||
postProcessors.sort(comparatorToUse);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user