Upgrade to Kotlin 1.5
* To align with the rest of Spring portfolio, based on Spring Framework 5.3.x generation, it is better to upgrade to the Kotlin version supported by SF * Fix `ClassUtils.isLambda()` to treat `$inlined$` classes as Kotlin lambdas and let Java DSL to delegate to the `LambdaMessageProcessor` for better expected type handling. Looks like Kotlin does not carry type info in its lambdas anymore (at least for functions). * Add `-parameters` to the compiler args for possible method argument names discovery. Essentially realign with the rest of portfolio * Fix Kotlin tests for deprecated API
This commit is contained in:
committed by
Gary Russell
parent
0f2285d5a3
commit
0fb64f1762
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2021 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -235,13 +235,14 @@ public abstract class ClassUtils {
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if class is Java lambda.
|
||||
* Check if class is Java or Kotlin lambda.
|
||||
* @param aClass the {@link Class} to check.
|
||||
* @return true if class is a Java lambda.
|
||||
* @return true if class is a Java or Kotlin lambda.
|
||||
* @since 5.2
|
||||
*/
|
||||
public static boolean isLambda(Class<?> aClass) {
|
||||
return aClass.isSynthetic() && !aClass.isAnonymousClass() && !aClass.isLocalClass();
|
||||
return (aClass.isSynthetic() && !aClass.isAnonymousClass() && !aClass.isLocalClass())
|
||||
|| aClass.getName().contains("$inlined$"); // for Kotlin lambdas
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user