修改泛型问题#50

This commit is contained in:
xingzi 2020-08-06 15:19:41 +08:00
parent 3b7fffbb6d
commit ba33cf2b60
3 changed files with 10 additions and 10 deletions

View File

@ -109,7 +109,7 @@ public class JsonBuildHelper {
//添加泛型对应关系
if (cls != null && null != cls.getTypeParameters()) {
List<JavaTypeVariable<JavaGenericDeclaration>> variables = cls.getTypeParameters();
for (int i = 0; i < cls.getTypeParameters().size(); i++) {
for (int i = 0; i < cls.getTypeParameters().size() && i<globGicName.length; i++) {
genericMap.put(variables.get(i).getName(), globGicName[i]);
}
}

View File

@ -76,7 +76,7 @@ public class ParamsBuildHelper {
//如果存在泛型 则将泛型与类名的对应关系存起来
if (cls != null && null != cls.getTypeParameters()) {
List<JavaTypeVariable<JavaGenericDeclaration>> variables = cls.getTypeParameters();
for (int i = 0; i < cls.getTypeParameters().size(); i++) {
for (int i = 0; i < cls.getTypeParameters().size() && i<globGicName.length; i++) {
genericMap.put(variables.get(i).getName(), globGicName[i]);
}
}

View File

@ -97,14 +97,14 @@ public class RpcDocBuildTemplate implements IDocBuildTemplate<RpcApiDoc> {
throw new RuntimeException("Unable to find comment for method " + method.getName() + " in " + cls.getCanonicalName());
}
boolean deprecated = false;
//RPC没有注解
// List<JavaAnnotation> annotations = method.getAnnotations();
// for (JavaAnnotation annotation : annotations) {
// String annotationName = annotation.getType().getName();
// if (DocAnnotationConstants.DEPRECATED.equals(annotationName)) {
// deprecated = true;
// }
// }
//设置当前接口是否过时
List<JavaAnnotation> annotations = method.getAnnotations();
for (JavaAnnotation annotation : annotations) {
String annotationName = annotation.getType().getName();
if (DocAnnotationConstants.DEPRECATED.equals(annotationName)) {
deprecated = true;
}
}
methodOrder++;
JavaMethodDoc apiMethodDoc = new JavaMethodDoc();
String methodDefine = methodDefinition(method);