Fix ActualType display.

This commit is contained in:
oppofind 2020-09-24 17:59:17 +08:00
parent 99a5e40540
commit 6e8f1549d5
2 changed files with 6 additions and 1 deletions

View File

@ -250,7 +250,9 @@ public class ParamsBuildHelper {
if (displayActualType) {
if (globGicName.length > 0) {
String gicName = genericMap.get(subTypeName) != null ? genericMap.get(subTypeName) : globGicName[0];
appendComment = " (ActualType: " + JavaClassUtil.getClassSimpleName(gicName) + ")";
if(!simpleName.equals(gicName)){
appendComment = " (ActualType: " + JavaClassUtil.getClassSimpleName(gicName) + ")";
}
}
if (Objects.nonNull(docField.getActualJavaType())) {
appendComment = " (ActualType: " + JavaClassUtil.getClassSimpleName(docField.getActualJavaType()) + ")";

View File

@ -213,6 +213,9 @@ public class JavaClassUtil {
*/
public static String getClassSimpleName(String className) {
if (className.contains(".")) {
if (className.contains("<")) {
className = className.substring(0, className.indexOf("<"));
}
int index = className.lastIndexOf(".");
className = className.substring(index + 1);
}