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) {
4040 default String param0 () {
4141 return null ;
4242 }
43- /**
44- * Return all types associated with this Utype.
45- */
46- default List <String > allTypes () {
47- return List .of ();
48- }
4943
5044 /**
5145 * Return the second generic parameter.
@@ -112,7 +106,7 @@ public String full() {
112106
113107 @ Override
114108 public Set <String > importTypes () {
115- return Collections .singleton (rawType );
109+ return rawType . startsWith ( "java.lang." ) ? Set . of () : Collections .singleton (rawType );
116110 }
117111
118112 @ Override
@@ -130,10 +124,6 @@ public String mainType() {
130124 return rawType ;
131125 }
132126
133- @ Override
134- public List <String > allTypes () {
135- return List .of (rawType );
136- }
137127 }
138128
139129 /**
@@ -212,11 +202,6 @@ public String mainType() {
212202 return allTypes .isEmpty () ? null : allTypes .get (0 );
213203 }
214204
215- @ Override
216- public List <String > allTypes () {
217- return allTypes ;
218- }
219-
220205 @ Override
221206 public String param0 () {
222207 return allTypes .size () < 2 ? null : allTypes .get (1 );
Original file line number Diff line number Diff line change 11package io .avaje .http .generator .javalin ;
22
33import java .io .IOException ;
4- import java .util .List ;
54import java .util .Map ;
5+ import java .util .Set ;
66
77import io .avaje .http .generator .core .BaseControllerWriter ;
88import io .avaje .http .generator .core .Constants ;
@@ -32,9 +32,8 @@ class ControllerWriter extends BaseControllerWriter {
3232 reader .addImportType ("io.avaje.jsonb.Types" );
3333 this .jsonTypes = JsonBUtil .jsonTypes (reader );
3434 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 )
3837 .forEach (reader ::addImportType );
3938 } else {
4039 this .jsonTypes = Map .of ();
Original file line number Diff line number Diff line change 55import java .io .IOException ;
66import java .util .List ;
77import java .util .Map ;
8+ import java .util .Set ;
89
910/**
1011 * Write Helidon specific web route adapter (a Helidon Service).
@@ -24,9 +25,8 @@ class ControllerWriter extends BaseControllerWriter {
2425 reader .addImportType ("io.avaje.jsonb.Types" );
2526 this .jsonTypes = JsonBUtil .jsonTypes (reader );
2627 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 )
3030 .forEach (reader ::addImportType );
3131 } else {
3232 this .jsonTypes = Map .of ();
You can’t perform that action at this time.
0 commit comments