Skip to content

Commit 43409b0

Browse files
committed
Refine KotlinDetector.isKotlinType documentation
This commit documents changes in lambda detection as of Kotlin 2.0. Closes gh-32905
1 parent d55abc6 commit 43409b0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

spring-core/src/main/java/org/springframework/core/KotlinDetector.java

+4
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,10 @@ public static boolean isKotlinReflectPresent() {
8484
/**
8585
* Determine whether the given {@code Class} is a Kotlin type
8686
* (with Kotlin metadata present on it).
87+
*
88+
* <p>As of Kotlin 2.0, this method can't be used to detect Kotlin
89+
* lambdas unless they are annotated with <code>@JvmSerializableLambda</code>
90+
* as invokedynamic has become the default method for lambda generation.
8791
*/
8892
public static boolean isKotlinType(Class<?> clazz) {
8993
return (kotlinMetadata != null && clazz.getDeclaredAnnotation(kotlinMetadata) != null);

0 commit comments

Comments
 (0)