From fb9dbb0cc2919e9376c149cdd4b57101567e76a2 Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Tue, 11 Aug 2020 15:38:04 +0200 Subject: [PATCH] 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. --- .../repository/core/support/RepositoryMethodInvoker.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/springframework/data/repository/core/support/RepositoryMethodInvoker.java b/src/main/java/org/springframework/data/repository/core/support/RepositoryMethodInvoker.java index 9253f7a33..efe2e789c 100644 --- a/src/main/java/org/springframework/data/repository/core/support/RepositoryMethodInvoker.java +++ b/src/main/java/org/springframework/data/repository/core/support/RepositoryMethodInvoker.java @@ -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())