From a639b0dc797f557a3bfba1620703f231a75d8c5f 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 041796659ddf3..abe1546f86896 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 @@ -565,8 +565,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) {