Skip array sort when the length of array not greater than 1
Closes gh-30934
This commit is contained in:
parent
da7b68a643
commit
07a1aea9c7
|
@ -1472,7 +1472,7 @@ public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFacto
|
|||
}
|
||||
TypeConverter converter = (typeConverter != null ? typeConverter : getTypeConverter());
|
||||
Object result = converter.convertIfNecessary(matchingBeans.values(), resolvedArrayType);
|
||||
if (result instanceof Object[] array) {
|
||||
if (result instanceof Object[] array && array.length > 1) {
|
||||
Comparator<Object> comparator = adaptDependencyComparator(matchingBeans);
|
||||
if (comparator != null) {
|
||||
Arrays.sort(array, comparator);
|
||||
|
|
Loading…
Reference in New Issue