File tree Expand file tree Collapse file tree 3 files changed +7
-23
lines changed
http-generator-core/src/main/java/io/avaje/http/generator/core
http-generator-javalin/src/main/java/io/avaje/http/generator/javalin
http-generator-nima/src/main/java/io/avaje/http/generator/helidon/nima Expand file tree Collapse file tree 3 files changed +7
-23
lines changed Original file line number Diff line number Diff line change @@ -40,12 +40,6 @@ static UType parse(TypeMirror type) {
40
40
default String param0 () {
41
41
return null ;
42
42
}
43
- /**
44
- * Return all types associated with this Utype.
45
- */
46
- default List <String > allTypes () {
47
- return List .of ();
48
- }
49
43
50
44
/**
51
45
* Return the second generic parameter.
@@ -112,7 +106,7 @@ public String full() {
112
106
113
107
@ Override
114
108
public Set <String > importTypes () {
115
- return Collections .singleton (rawType );
109
+ return rawType . startsWith ( "java.lang." ) ? Set . of () : Collections .singleton (rawType );
116
110
}
117
111
118
112
@ Override
@@ -130,10 +124,6 @@ public String mainType() {
130
124
return rawType ;
131
125
}
132
126
133
- @ Override
134
- public List <String > allTypes () {
135
- return List .of (rawType );
136
- }
137
127
}
138
128
139
129
/**
@@ -212,11 +202,6 @@ public String mainType() {
212
202
return allTypes .isEmpty () ? null : allTypes .get (0 );
213
203
}
214
204
215
- @ Override
216
- public List <String > allTypes () {
217
- return allTypes ;
218
- }
219
-
220
205
@ Override
221
206
public String param0 () {
222
207
return allTypes .size () < 2 ? null : allTypes .get (1 );
Original file line number Diff line number Diff line change 1
1
package io .avaje .http .generator .javalin ;
2
2
3
3
import java .io .IOException ;
4
- import java .util .List ;
5
4
import java .util .Map ;
5
+ import java .util .Set ;
6
6
7
7
import io .avaje .http .generator .core .BaseControllerWriter ;
8
8
import io .avaje .http .generator .core .Constants ;
@@ -32,9 +32,8 @@ class ControllerWriter extends BaseControllerWriter {
32
32
reader .addImportType ("io.avaje.jsonb.Types" );
33
33
this .jsonTypes = JsonBUtil .jsonTypes (reader );
34
34
jsonTypes .values ().stream ()
35
- .map (UType ::allTypes )
36
- .flatMap (List ::stream )
37
- .filter (s -> !s .contains ("java.lang" ))
35
+ .map (UType ::importTypes )
36
+ .flatMap (Set ::stream )
38
37
.forEach (reader ::addImportType );
39
38
} else {
40
39
this .jsonTypes = Map .of ();
Original file line number Diff line number Diff line change 5
5
import java .io .IOException ;
6
6
import java .util .List ;
7
7
import java .util .Map ;
8
+ import java .util .Set ;
8
9
9
10
/**
10
11
* Write Helidon specific web route adapter (a Helidon Service).
@@ -24,9 +25,8 @@ class ControllerWriter extends BaseControllerWriter {
24
25
reader .addImportType ("io.avaje.jsonb.Types" );
25
26
this .jsonTypes = JsonBUtil .jsonTypes (reader );
26
27
jsonTypes .values ().stream ()
27
- .map (UType ::allTypes )
28
- .flatMap (List ::stream )
29
- .filter (s -> !s .contains ("java.lang" ))
28
+ .map (UType ::importTypes )
29
+ .flatMap (Set ::stream )
30
30
.forEach (reader ::addImportType );
31
31
} else {
32
32
this .jsonTypes = Map .of ();
You can’t perform that action at this time.
0 commit comments