diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/DefaultBindConstructorProvider.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/DefaultBindConstructorProvider.java index 25d59c6bbf..4102a97e45 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/DefaultBindConstructorProvider.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/DefaultBindConstructorProvider.java @@ -21,8 +21,6 @@ import java.lang.reflect.Modifier; 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; @@ -106,7 +104,7 @@ class DefaultBindConstructorProvider implements BindConstructorProvider { 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); @@ -198,10 +196,6 @@ class DefaultBindConstructorProvider implements BindConstructorProvider { 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); }