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 1, 2024
1 parent 52e57f8 commit a639b0d
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<ServerRestHandler> handlers) {
Expand Down

0 comments on commit a639b0d

Please sign in to comment.