@@ -88,12 +88,12 @@ private void writeContextReturn() {
88
88
// Support for CompletableFuture's.
89
89
final UType type = UType .parse (method .returnType ());
90
90
if (type .isGeneric () && type .mainType ().equals ("java.util.concurrent.CompletableFuture" )) {
91
- final String returnVariableName = "futureResult" ;
91
+ final String futureResultVariableName = "futureResult" ;
92
92
93
93
writer .append (" ctx.future(() -> {" ).eol ();
94
- writer .append (" return result.thenAccept(%s -> {" , returnVariableName ).eol ();
94
+ writer .append (" return result.thenAccept(%s -> {" , futureResultVariableName ).eol ();
95
95
writer .append (" " );
96
- this .writeContextReturn (returnVariableName );
96
+ this .writeContextReturn (futureResultVariableName );
97
97
writer .eol ().append (" });" ).eol ();
98
98
writer .append (" });" ).eol ();
99
99
return ;
@@ -103,7 +103,7 @@ private void writeContextReturn() {
103
103
this .writeContextReturn ("result" );
104
104
}
105
105
106
- private void writeContextReturn (final String returnVariableName ) {
106
+ private void writeContextReturn (final String resultVariableName ) {
107
107
final var produces = method .produces ();
108
108
if (produces == null || MediaType .APPLICATION_JSON .equalsIgnoreCase (produces )) {
109
109
if (useJsonB ) {
@@ -112,16 +112,16 @@ private void writeContextReturn(final String returnVariableName) {
112
112
uType = uType .paramRaw ();
113
113
}
114
114
115
- writer .append (" %sJsonType.toJson(%s, ctx.contentType(\" application/json\" ).outputStream());" , uType .shortName (), returnVariableName );
115
+ writer .append (" %sJsonType.toJson(%s, ctx.contentType(\" application/json\" ).outputStream());" , uType .shortName (), resultVariableName );
116
116
} else {
117
- writer .append (" ctx.json(%s);" , returnVariableName );
117
+ writer .append (" ctx.json(%s);" , resultVariableName );
118
118
}
119
119
} else if (MediaType .TEXT_HTML .equalsIgnoreCase (produces )) {
120
- writer .append (" ctx.html(%s);" , returnVariableName );
120
+ writer .append (" ctx.html(%s);" , resultVariableName );
121
121
} else if (MediaType .TEXT_PLAIN .equalsIgnoreCase (produces )) {
122
- writer .append (" ctx.contentType(\" text/plain\" ).result(%s);" , returnVariableName );
122
+ writer .append (" ctx.contentType(\" text/plain\" ).result(%s);" , resultVariableName );
123
123
} else {
124
- writer .append (" ctx.contentType(\" %s\" ).result(%s);" , produces , returnVariableName );
124
+ writer .append (" ctx.contentType(\" %s\" ).result(%s);" , produces , resultVariableName );
125
125
}
126
126
}
127
127
}
0 commit comments