Skip to content

Commit 98df8c0

Browse files
committed
rename k
1 parent 532fc3b commit 98df8c0

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

http-generator-nima/src/main/java/io/avaje/http/generator/helidon/nima/ControllerWriter.java

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,10 @@ public void writeFieldJsonBodyType(MethodReader methodReader) {
149149
final var fullType = param.getUType().full();
150150
jsonTypes.computeIfAbsent(
151151
fullType,
152-
k -> {
152+
type -> {
153153
final var baseType = getBaseType(param.getUType());
154-
final var fieldName = createFieldName(baseType, k);
155-
writer.append("private final JsonType<%s> %sJsonType;", k, fieldName).eol();
154+
final var fieldName = createFieldName(baseType, type);
155+
writer.append("private final JsonType<%s> %sJsonType;", type, fieldName).eol();
156156
return new JsonbType(baseType, fieldName);
157157
});
158158
});
@@ -161,28 +161,26 @@ public void writeFieldJsonBodyType(MethodReader methodReader) {
161161

162162
public void writeFieldJsonReturnType(MethodReader methodReader) {
163163

164-
methodReader.getReturnType().getKind();
165-
166164
// return types
167165
if (methodReader.getReturnType() instanceof final DeclaredType fullType) {
168166
final var fullTypeString = fullType.toString();
169167
jsonTypes.computeIfAbsent(
170168
fullTypeString,
171-
k -> {
169+
type -> {
172170
final var baseType = getBaseType(fullType);
173-
final var fieldName = createFieldName(baseType, k);
174-
writer.append("private final JsonType<%s> %sJsonType;", k, fieldName).eol();
171+
final var fieldName = createFieldName(baseType, type);
172+
writer.append("private final JsonType<%s> %sJsonType;", type, fieldName).eol();
175173
return new JsonbType(baseType, fieldName);
176174
});
177175
} else if (methodReader.getReturnType() instanceof final PrimitiveType fullType) {
178176

179177
jsonTypes.computeIfAbsent(
180178
fullType.toString(),
181-
k -> {
179+
type -> {
182180
final var baseType =
183-
"int".equals(k) ? "Integer" : k.substring(0, 1).toUpperCase() + k.substring(1);
184-
writer.append("private final JsonType<%s> %sJsonType;", baseType, k).eol();
185-
return new JsonbType(baseType, k);
181+
"int".equals(type) ? "Integer" : type.substring(0, 1).toUpperCase() + type.substring(1);
182+
writer.append("private final JsonType<%s> %sJsonType;", baseType, type).eol();
183+
return new JsonbType(baseType, type);
186184
});
187185
} else {
188186
throw new UnsupportedOperationException(

0 commit comments

Comments
 (0)