Skip to content

Commit bd8e682

Browse files
author
heqiang
authored
Simplify BeanUtils.findPrimaryConstructor()
Closes gh-26519
1 parent f7c952c commit bd8e682

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

spring-beans/src/main/java/org/springframework/beans/BeanUtils.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -268,10 +268,7 @@ public static <T> Constructor<T> getResolvableConstructor(Class<T> clazz) {
268268
public static <T> Constructor<T> findPrimaryConstructor(Class<T> clazz) {
269269
Assert.notNull(clazz, "Class must not be null");
270270
if (KotlinDetector.isKotlinReflectPresent() && KotlinDetector.isKotlinType(clazz)) {
271-
Constructor<T> kotlinPrimaryConstructor = KotlinDelegate.findPrimaryConstructor(clazz);
272-
if (kotlinPrimaryConstructor != null) {
273-
return kotlinPrimaryConstructor;
274-
}
271+
return KotlinDelegate.findPrimaryConstructor(clazz);
275272
}
276273
return null;
277274
}

0 commit comments

Comments
 (0)