Skip to content

Commit

Permalink
Treat Kotlin's Unit as void for the Quarkus REST scoring system
Browse files Browse the repository at this point in the history
Fixes: quarkusio#42159
(cherry picked from commit 104de69)
  • Loading branch information
geoand authored and gsmet committed Aug 14, 2024
1 parent eba9c95 commit ee74de3
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<ServerRestHandler> handlers) {
Expand Down

0 comments on commit ee74de3

Please sign in to comment.