File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed
http-generator-core/src/main/java/io/avaje/http/generator/core Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -16,11 +16,12 @@ public class Util {
16
16
* Parse the raw type potentially handling generic parameters.
17
17
*/
18
18
public static UType parse (String rawType ) {
19
- int pos = rawType .indexOf ('<' );
19
+ var type = trimAnnotations (rawType );
20
+ int pos = type .indexOf ('<' );
20
21
if (pos == -1 ) {
21
- return new UType .Basic (rawType );
22
+ return new UType .Basic (type );
22
23
} else {
23
- return new UType .Generic (rawType );
24
+ return new UType .Generic (type );
24
25
}
25
26
}
26
27
@@ -30,10 +31,19 @@ public static UType parse(String rawType) {
30
31
public static String typeDef (TypeMirror typeMirror ) {
31
32
if (typeMirror .getKind () == TypeKind .DECLARED ) {
32
33
DeclaredType declaredType = (DeclaredType ) typeMirror ;
34
+
33
35
return declaredType .asElement ().toString ();
34
36
} else {
35
- return typeMirror .toString ();
37
+ return trimAnnotations (typeMirror .toString ());
38
+ }
39
+ }
40
+
41
+ static String trimAnnotations (String type ) {
42
+ int pos = type .indexOf ("@" );
43
+ if (pos == -1 ) {
44
+ return type ;
36
45
}
46
+ return type .substring (0 , pos ) + type .substring (type .lastIndexOf (' ' ) + 1 );
37
47
}
38
48
39
49
static String trimPath (String value ) {
You can’t perform that action at this time.
0 commit comments