Skip to content
This repository was archived by the owner on Dec 4, 2025. It is now read-only.

Commit 5526a06

Browse files
authored
Merge pull request #785 from suihe1/master
Import enum class, comment @see after writing only the class name can not find the corresponding enum
2 parents 20a427c + 1b9e931 commit 5526a06

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/main/java/com/ly/doc/utils/JavaClassUtil.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -394,16 +394,18 @@ public static JavaClass getSeeEnum(JavaField javaField, ProjectDocConfigBuilder
394394
return null;
395395
}
396396
String value = see.getValue();
397-
if (!JavaClassValidateUtil.isClassName(value)) {
398-
return null;
399-
}
397+
400398
// not FullyQualifiedName
401399
if (!StringUtils.contains(value, ".")) {
402400
List<String> imports = javaField.getDeclaringClass().getSource().getImports();
403401
String finalValue = value;
404402
value = imports.stream().filter(i -> StringUtils.endsWith(i, finalValue)).findFirst().orElse(StringUtils.EMPTY);
405403
}
406404

405+
if (!JavaClassValidateUtil.isClassName(value)) {
406+
return null;
407+
}
408+
407409
JavaClass enumClass = builder.getJavaProjectBuilder().getClassByName(value);
408410
if (enumClass.isEnum()) {
409411
return enumClass;

0 commit comments

Comments
 (0)