Skip to content

Commit

Permalink
Send
Browse files Browse the repository at this point in the history
  • Loading branch information
noboomu committed Sep 15, 2020
1 parent 2621026 commit ee7ad65
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ protected void addClassMethodHandlers(TypeSpec.Builder typeBuilder, Class<?> cla


if (m.getReturnType().equals(ServerResponse.class)) {
methodBuilder.addStatement("$L.send(this,$L)", "response", "exchange");
methodBuilder.addStatement("$L.send($L)", "response", "exchange");

} else if ((m.getGenericReturnType().toString().contains("java.util.concurrent.CompletionStage") && m.getGenericReturnType().toString().contains("ServerResponse"))
|| (m.getGenericReturnType().toString().contains("java.util.concurrent.CompletableFuture") && m.getGenericReturnType().toString().contains("ServerResponse")))
Expand All @@ -687,7 +687,7 @@ protected void addClassMethodHandlers(TypeSpec.Builder typeBuilder, Class<?> cla
methodBuilder.beginControlFlow("", "");

methodBuilder.addCode(
"$L.thenAccept( r -> r.send(null,$L) )\n\t.exceptionally( ex -> ",
"$L.thenAccept( r -> r.send($L) )\n\t.exceptionally( ex -> ",
"response", "exchange");
methodBuilder.beginControlFlow("", "");
methodBuilder.addCode("\t\tthrow new java.util.concurrent.CompletionException(ex);\n\t");
Expand Down Expand Up @@ -720,7 +720,7 @@ else if (m.getReturnType().getTypeName().contains("java.util.concurrent.Completi


methodBuilder.addCode(
"$L.thenAccept( r -> io.sinistral.proteus.server.ServerResponse.response(r)" + postProcess + "send(this,$L) )\n\t.exceptionally( ex -> ",
"$L.thenAccept( r -> io.sinistral.proteus.server.ServerResponse.response(r)" + postProcess + "send($L) )\n\t.exceptionally( ex -> ",
"response", "exchange");
methodBuilder.beginControlFlow("", "");
methodBuilder.addCode("\t\tthrow new java.util.concurrent.CompletionException(ex);\n\t");
Expand Down

0 comments on commit ee7ad65

Please sign in to comment.