We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0e7aba4 commit 05b1581Copy full SHA for 05b1581
spring-beans/src/main/java/org/springframework/beans/factory/support/RootBeanDefinition.java
@@ -401,8 +401,8 @@ public Constructor<?>[] getPreferredConstructors() {
401
if (attribute instanceof Constructor<?> constructor) {
402
return new Constructor<?>[] {constructor};
403
}
404
- if (attribute instanceof Constructor<?>[]) {
405
- return (Constructor<?>[]) attribute;
+ if (attribute instanceof Constructor<?>[] constructors) {
+ return constructors;
406
407
throw new IllegalArgumentException("Invalid value type for attribute '" +
408
PREFERRED_CONSTRUCTORS_ATTRIBUTE + "': " + attribute.getClass().getName());
0 commit comments