-
Notifications
You must be signed in to change notification settings - Fork 888
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RESTEASY-2612] Support CompletableFuture resource method return type #2727
Conversation
Hello, spyrkob. I'm waiting for one of the admins to verify this patch with /ok-to-test in a comment. |
@@ -1115,17 +1115,18 @@ public <T extends Throwable> ExceptionMapper<T> getExceptionMapperForClass(Class | |||
public <T> AsyncResponseProvider<T> getAsyncResponseProvider(Class<T> type) | |||
{ | |||
Class asyncType = type; | |||
AsyncResponseProvider<T> mapper = null; | |||
while (mapper == null) | |||
if (getAsyncResponseProviders() == null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the three calls to getAsyncResponseProviders()
be stored in a local and re-used?
* @tpSince RESTEasy 4.7 | ||
*/ | ||
@Test | ||
public void testCompletabeFutureText() throws Exception |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo, Completabe
Thanks for the review @stevenschlansker, I updated and rebased the PR |
@@ -1021,17 +1021,16 @@ public <T extends Throwable> ExceptionMapper<T> getExceptionMapperForClass(Class | |||
// @Override | |||
public <T> AsyncResponseProvider<T> getAsyncResponseProvider(Class<T> type) { | |||
Class asyncType = type; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be removed and the usage below could just be replaced by the type
argument.
} | ||
return mapper; | ||
return null; | ||
} | ||
|
||
public <T> AsyncClientResponseProvider<T> getAsyncClientResponseProvider(Class<T> type) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably do the same thing from above here. Possibly with the getAsyncStreamProvider()
too.
for (Class<?> aClass : asyncResponseProviders.keySet()) { | ||
if (aClass.isAssignableFrom(asyncType)) { | ||
return asyncResponseProviders.get(aClass); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure we should remove the type.getSuperClass()
checking. That's a change in behavior. My assumption is this is done so we don't check the CompletionStatge
, but maybe I'm wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jamezp sorry for delay, I must have missed the notification
I added back the type.getSuperClass check. I assumed it was an attempt to check if the return type extends CompletionStage
but maybe there's another case that it was meant to handle
Hello, |
Hi @florian-signoret-ibm, |
e182428
to
c36cd93
Compare
Issue: https://issues.redhat.com/browse/RESTEASY-2612