See gh-35185
This commit is contained in:
Johnny Lim
2023-04-28 01:02:02 +09:00
committed by Moritz Halbritter
parent 394fb6424c
commit ff9fd1abeb
12 changed files with 21 additions and 21 deletions

View File

@@ -1364,8 +1364,8 @@ public class SpringApplication {
* writing a test harness that needs to start an application with additional
* configuration.
* @param main the main method entry point that runs the {@link SpringApplication}
* @return an {@link SpringApplication.Augmented} instance that can be used to add
* configuration and run the application.
* @return a {@link SpringApplication.Augmented} instance that can be used to add
* configuration and run the application
* @since 3.1.0
* @see #withHook(SpringApplicationHook, Runnable)
*/

View File

@@ -102,7 +102,6 @@ class DefaultBindConstructorProvider implements BindConstructorProvider {
boolean hasAutowiredConstructor = isAutowiredPresent(type);
Constructor<?>[] candidates = getCandidateConstructors(type);
MergedAnnotations[] candidateAnnotations = getAnnotations(candidates);
boolean kotlinType = isKotlinType(type);
boolean deducedBindConstructor = false;
boolean immutableType = type.isRecord();
Constructor<?> bind = getConstructorBindingAnnotated(type, candidates, candidateAnnotations);
@@ -110,7 +109,7 @@ class DefaultBindConstructorProvider implements BindConstructorProvider {
bind = deduceBindConstructor(type, candidates);
deducedBindConstructor = bind != null;
}
if (bind == null && !hasAutowiredConstructor && kotlinType) {
if (bind == null && !hasAutowiredConstructor && isKotlinType(type)) {
bind = deduceKotlinBindConstructor(type);
deducedBindConstructor = bind != null;
}