Improve support of Kotlin beans w/ primary and default ctors
This commit add the default constructor if available as fallback after to the primary constructor. Issue: SPR-16012
This commit is contained in:
@@ -367,7 +367,9 @@ public class AutowiredAnnotationBeanPostProcessor extends InstantiationAwareBean
|
||||
candidateConstructors = new Constructor<?>[] {rawCandidates[0]};
|
||||
}
|
||||
else if (kotlinPrimaryConstructor != null) {
|
||||
candidateConstructors = new Constructor<?>[] {kotlinPrimaryConstructor};
|
||||
candidateConstructors = (defaultConstructor != null ?
|
||||
new Constructor<?>[] {kotlinPrimaryConstructor, defaultConstructor} :
|
||||
new Constructor<?>[] {kotlinPrimaryConstructor});
|
||||
}
|
||||
else {
|
||||
candidateConstructors = new Constructor<?>[0];
|
||||
|
||||
Reference in New Issue
Block a user