Simplify BeanUtils.findPrimaryConstructor()

Closes gh-26519
This commit is contained in:
heqiang
2021-02-08 20:45:40 +08:00
committed by GitHub
parent f7c952cb3e
commit bd8e682c51

View File

@@ -268,10 +268,7 @@ public abstract class BeanUtils {
public static <T> Constructor<T> findPrimaryConstructor(Class<T> clazz) {
Assert.notNull(clazz, "Class must not be null");
if (KotlinDetector.isKotlinReflectPresent() && KotlinDetector.isKotlinType(clazz)) {
Constructor<T> kotlinPrimaryConstructor = KotlinDelegate.findPrimaryConstructor(clazz);
if (kotlinPrimaryConstructor != null) {
return kotlinPrimaryConstructor;
}
return KotlinDelegate.findPrimaryConstructor(clazz);
}
return null;
}