diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java index 9fbeb6a12890..c7e52d1031f9 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java @@ -1472,7 +1472,7 @@ else if (type.isArray()) { } 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 comparator = adaptDependencyComparator(matchingBeans); if (comparator != null) { Arrays.sort(array, comparator);