修改dubbo返回泛型的T是byte数组时抛出异常问题 #48

This commit is contained in:
xingzi 2020-07-25 14:13:48 +08:00
parent 5ce3b54da4
commit c1908d1329
2 changed files with 10 additions and 0 deletions

View File

@ -271,6 +271,9 @@ public class RpcDocBuildTemplate implements IDocBuildTemplate<RpcApiDoc> {
returnClass = returnClass.replace(simpleReturn, JavaClassUtil.getClassSimpleName(simpleReturn));
String[] arrays = DocClassUtil.getSimpleGicName(returnClass);
for (String str : arrays) {
if(str.contains("[")){
str = str.substring(0,str.indexOf("["));
}
returnClass = returnClass.replaceAll(str, JavaClassUtil.getClassSimpleName(str));
}
methodBuilder.append(returnClass).append(" ");

View File

@ -201,6 +201,13 @@ public class JavaClassUtil {
int index = className.lastIndexOf(".");
className = className.substring(index + 1, className.length());
}
if (className.contains("[")) {
int index = className.indexOf("[");
className = className.substring(0, index);
}
if (className.contains(">")) {
className = className.substring(0,className.length() - 1);
}
return className;
}