Correctly detect Optional return type for @HttpExchange methods
Prior to this commit, a ClassCastException was thrown for an Optional return type for an @HttpExchange method. This is because the check for an Optional return type was based on the type contained in the Optional instead of the Optional itself. Closes gh-28493
This commit is contained in:
@@ -324,7 +324,7 @@ final class HttpServiceMethod {
|
||||
responseFunction = initBodyFunction(client, actualParam, reactiveAdapter);
|
||||
}
|
||||
|
||||
boolean blockForOptional = actualType.equals(Optional.class);
|
||||
boolean blockForOptional = returnType.equals(Optional.class);
|
||||
return new ResponseFunction(responseFunction, reactiveAdapter, blockForOptional, blockTimeout);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user