DATACMNS-1764 - Fix CoroutineAdapterInformation when Kotlin reflection is absent.

We now correctly determine the parameter count instead of returning a stating no-op object to correctly compare whether the target method uses the same count of arguments.

Original Pull Request: #455.
This commit is contained in:
Mark Paluch
2020-08-11 15:38:04 +02:00
parent 01e394b913
commit fb9dbb0cc2

View File

@@ -293,8 +293,6 @@ abstract class RepositoryMethodInvoker {
*/
static class CoroutineAdapterInformation {
private static CoroutineAdapterInformation DISABLED = new CoroutineAdapterInformation(false, false, false, 0, 0);
private final boolean suspendedDeclaredMethod;
private final boolean suspendedBaseClassMethod;
private final boolean reactiveBaseClassMethod;
@@ -320,7 +318,8 @@ abstract class RepositoryMethodInvoker {
public static CoroutineAdapterInformation create(Method declaredMethod, Method baseClassMethod) {
if (!KotlinDetector.isKotlinReflectPresent()) {
return DISABLED;
return new CoroutineAdapterInformation(false, false, false, declaredMethod.getParameterCount(),
baseClassMethod.getParameterCount());
}
KFunction<?> declaredFunction = KotlinDetector.isKotlinType(declaredMethod.getDeclaringClass())