Update
This commit is contained in:
parent
bda42291c7
commit
65cce6d806
@ -16,16 +16,16 @@ public class CustomTypesConfiguration {
|
|||||||
public TypeName getJavaClassType() {
|
public TypeName getJavaClassType() {
|
||||||
int indexOfGeneric;
|
int indexOfGeneric;
|
||||||
if ((indexOfGeneric = javaClass.indexOf("<")) == -1) {
|
if ((indexOfGeneric = javaClass.indexOf("<")) == -1) {
|
||||||
return ClassName.bestGuess(javaClass);
|
return ClassName.bestGuess(javaClass.trim());
|
||||||
} else {
|
} else {
|
||||||
var rawTypesArray = javaClass.substring(indexOfGeneric + 1, javaClass.length() - 1).split(",");
|
var rawTypesArray = javaClass.substring(indexOfGeneric + 1, javaClass.length() - 1).split(",");
|
||||||
var genericsResult = new TypeName[rawTypesArray.length];
|
var genericsResult = new TypeName[rawTypesArray.length];
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for (String rawType : rawTypesArray) {
|
for (String rawType : rawTypesArray) {
|
||||||
genericsResult[i] = ClassName.bestGuess(rawType);
|
genericsResult[i] = ClassName.bestGuess(rawType.trim());
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
var base = ClassName.bestGuess(javaClass.substring(0, indexOfGeneric));
|
var base = ClassName.bestGuess(javaClass.substring(0, indexOfGeneric).trim());
|
||||||
return ParameterizedTypeName.get(base, genericsResult);
|
return ParameterizedTypeName.get(base, genericsResult);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user