enhance pull #152 .

This commit is contained in:
shalousun 2021-09-02 23:12:14 +08:00
parent 2eedb8fa4b
commit e64cfdcbda
2 changed files with 9 additions and 3 deletions

View File

@ -152,7 +152,13 @@ public class JsonBuildHelper {
data0.append("{");
String[] globGicName = DocClassUtil.getSimpleGicName(genericCanonicalName);
if (Objects.isNull(globGicName) || globGicName.length < 1) {
// obtain generics from parent class
JavaClass superJavaClass = cls != null ? cls.getSuperJavaClass() : null;
if (Objects.nonNull(superJavaClass) && !"Object".equals(superJavaClass.getSimpleName())) {
globGicName = DocClassUtil.getSimpleGicName(superJavaClass.getGenericFullyQualifiedName());
}
}
JavaClassUtil.genericParamMap(genericMap, cls, globGicName);
StringBuilder data = new StringBuilder();
if (JavaClassValidateUtil.isCollection(typeName) || JavaClassValidateUtil.isArray(typeName)) {

View File

@ -82,8 +82,8 @@ public class ParamsBuildHelper {
String simpleName = DocClassUtil.getSimpleName(className);
String[] globGicName = DocClassUtil.getSimpleGicName(className);
JavaClass cls = projectBuilder.getClassByName(simpleName);
if (globGicName == null || globGicName.length <= 0) {
//获取父类的泛型
if (Objects.isNull(globGicName) || globGicName.length < 1) {
// obtain generics from parent class
JavaClass superJavaClass = cls != null ? cls.getSuperJavaClass() : null;
if (superJavaClass != null && !"Object".equals(superJavaClass.getSimpleName())) {
globGicName = DocClassUtil.getSimpleGicName(superJavaClass.getGenericFullyQualifiedName());