Skip to content

Commit

Permalink
Merge branch '3.0.x'
Browse files Browse the repository at this point in the history
Closes gh-34611
  • Loading branch information
philwebb committed Mar 15, 2023
2 parents 65cbcb9 + 5d21c36 commit 837ea04
Showing 1 changed file with 1 addition and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
import java.util.Arrays;
import java.util.stream.Stream;

import kotlin.jvm.JvmClassMappingKt;

import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.KotlinDetector;
Expand Down Expand Up @@ -106,7 +104,7 @@ static Constructors getConstructors(Class<?> type, boolean isNestedConstructorBi
MergedAnnotations[] candidateAnnotations = getAnnotations(candidates);
boolean kotlinType = isKotlinType(type);
boolean deducedBindConstructor = false;
boolean immutableType = type.isRecord() || isKotlinDataClass(type);
boolean immutableType = type.isRecord();
Constructor<?> bind = getConstructorBindingAnnotated(type, candidates, candidateAnnotations);
if (bind == null && !hasAutowiredConstructor) {
bind = deduceBindConstructor(type, candidates);
Expand Down Expand Up @@ -198,10 +196,6 @@ private static Constructor<?> deduceBindConstructor(Class<?> type, Constructor<?
return (result != null && result.getParameterCount() > 0) ? result : null;
}

private static boolean isKotlinDataClass(Class<?> type) {
return isKotlinType(type) && JvmClassMappingKt.getKotlinClass(type).isData();
}

private static boolean isKotlinType(Class<?> type) {
return KotlinDetector.isKotlinPresent() && KotlinDetector.isKotlinType(type);
}
Expand Down

0 comments on commit 837ea04

Please sign in to comment.