From ee74de32fbe17c5bb39da76d1ad3c993b278df6b Mon Sep 17 00:00:00 2001 From: Georgios Andrianakis Date: Mon, 29 Jul 2024 10:38:16 +0300 Subject: [PATCH] Treat Kotlin's Unit as void for the Quarkus REST scoring system Fixes: #42159 (cherry picked from commit 104de690a1bacfd83f121a08bcd28748ef43a0f1) --- .../core/startup/RuntimeResourceDeployment.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/core/startup/RuntimeResourceDeployment.java b/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/core/startup/RuntimeResourceDeployment.java index e1bb21511e916..2fc5b2da24417 100644 --- a/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/core/startup/RuntimeResourceDeployment.java +++ b/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/core/startup/RuntimeResourceDeployment.java @@ -563,8 +563,16 @@ private static void smartInitParameterConverter(int i, ParameterConverter quarku } private static boolean isNotVoid(Class rawEffectiveReturnType) { - return rawEffectiveReturnType != Void.class - && rawEffectiveReturnType != void.class; + if (rawEffectiveReturnType == Void.class) { + return false; + } + if (rawEffectiveReturnType == void.class) { + return false; + } + if ("kotlin.Unit".equals(rawEffectiveReturnType.getName())) { + return false; + } + return true; } private void addResponseHandler(ServerResourceMethod method, List handlers) {