Skip to content

Commit ce90612

Browse files
committed
final jsonb
1 parent a6f74a9 commit ce90612

File tree

4 files changed

+14
-11
lines changed

4 files changed

+14
-11
lines changed

http-generator-client/src/main/java/io/avaje/http/generator/client/ClientMethodWriter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ private void writeResponse(UType type) {
139139
} else if (isHttpResponse(mainType)) {
140140
writeWithHandler();
141141
} else {
142-
writer.append(".bean(").eol();
142+
writer.append(".bean(");
143143
writeGeneric(type);
144144
}
145145
}

http-generator-client/src/main/java/io/avaje/http/generator/client/ClientProcessor.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,16 @@ public class ClientProcessor extends AbstractProcessor {
2727

2828
protected ProcessingContext ctx;
2929

30-
private boolean useJsonB;
30+
private final boolean useJsonB;
3131

3232
public ClientProcessor() {
33+
var jsonBOnClassPath = false;
3334
try {
3435
Class.forName("io.avaje.jsonb.Jsonb");
35-
this.useJsonB = true;
36+
jsonBOnClassPath = true;
3637
} catch (final ClassNotFoundException e) {
37-
this.useJsonB = false;
3838
}
39+
useJsonB = jsonBOnClassPath;
3940
}
4041

4142
public ClientProcessor(boolean useJsonb) {
@@ -122,7 +123,7 @@ private void writeClient(Element controller) {
122123
}
123124

124125
protected String writeClientAdapter(ProcessingContext ctx, ControllerReader reader) throws IOException {
125-
return new ClientWriter(reader, ctx,useJsonB).write();
126+
return new ClientWriter(reader, ctx, useJsonB).write();
126127
}
127128

128129
}

http-generator-javalin/src/main/java/io/avaje/http/generator/javalin/JavalinProcessor.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,16 @@
99

1010
public class JavalinProcessor extends BaseProcessor {
1111

12-
private boolean useJsonB;
12+
private final boolean useJsonB;
1313

1414
public JavalinProcessor() {
15+
var jsonBOnClassPath = false;
1516
try {
1617
Class.forName("io.avaje.jsonb.Jsonb");
17-
this.useJsonB = true;
18+
jsonBOnClassPath = true;
1819
} catch (final ClassNotFoundException e) {
19-
this.useJsonB = false;
2020
}
21+
useJsonB = jsonBOnClassPath;
2122
}
2223

2324
public JavalinProcessor(boolean useJsonb) {

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,16 @@
99

1010
public class NimaProcessor extends BaseProcessor {
1111

12-
private boolean jsonB;
12+
private final boolean jsonB;
1313

1414
public NimaProcessor() {
15+
var jsonBOnClassPath = false;
1516
try {
1617
Class.forName("io.avaje.jsonb.Jsonb");
17-
this.jsonB = true;
18+
jsonBOnClassPath = true;
1819
} catch (final ClassNotFoundException e) {
19-
this.jsonB = false;
2020
}
21+
jsonB = jsonBOnClassPath;
2122
}
2223

2324
public NimaProcessor(boolean useJsonb) {

0 commit comments

Comments
 (0)