Skip to content

Commit

Permalink
Fix duplicate fields,fix #34.
Browse files Browse the repository at this point in the history
  • Loading branch information
shalousun committed Nov 6, 2020
1 parent 8e26a72 commit 7484fdd
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/main/java/com/power/doc/utils/JavaClassUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public static List<DocJavaField> getFields(JavaClass cls1, int counter, Set<Stri
} else if ("Object".equals(cls1.getSimpleName()) || "Timestamp".equals(cls1.getSimpleName()) ||
"Date".equals(cls1.getSimpleName()) || "Locale".equals(cls1.getSimpleName())
|| "ClassLoader".equals(cls1.getSimpleName()) || JavaClassValidateUtil.isMap(cls1.getFullyQualifiedName())
||cls1.isEnum()) {
|| cls1.isEnum()) {
return fieldList;
} else {
String className = cls1.getFullyQualifiedName();
Expand All @@ -81,7 +81,7 @@ public static List<DocJavaField> getFields(JavaClass cls1, int counter, Set<Stri
methodName = StringUtil.firstToLowerCase(methodName.substring(2, methodName.length()));
enable = true;
}
if (!enable) {
if (!enable || addedFields.contains(methodName)) {
continue;
}
addedFields.add(methodName);
Expand Down Expand Up @@ -442,11 +442,10 @@ public static void genericParamMap(Map<String, String> genericMap, JavaClass cls
}
}

public static String javaTypeFormat(String returnType){
if(returnType.contains("?")) {
public static String javaTypeFormat(String returnType) {
if (returnType.contains("?")) {
return returnType.replaceAll("[?\\s]", "").replaceAll("extends", "");
}
else {
} else {
return returnType;
}
}
Expand Down

0 comments on commit 7484fdd

Please sign in to comment.