From ee7ad65ed1148166557a4f6633b0a015ff2f7383 Mon Sep 17 00:00:00 2001 From: Joshua Bauer Date: Tue, 15 Sep 2020 09:11:53 -0700 Subject: [PATCH] Send --- .../sinistral/proteus/server/handlers/HandlerGenerator.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/proteus-core/src/main/java/io/sinistral/proteus/server/handlers/HandlerGenerator.java b/proteus-core/src/main/java/io/sinistral/proteus/server/handlers/HandlerGenerator.java index b4f80f3..16edf76 100644 --- a/proteus-core/src/main/java/io/sinistral/proteus/server/handlers/HandlerGenerator.java +++ b/proteus-core/src/main/java/io/sinistral/proteus/server/handlers/HandlerGenerator.java @@ -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"))) @@ -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"); @@ -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");