From 1b9e93126bcdedf4a600df8d8c4c08c5502077c7 Mon Sep 17 00:00:00 2001 From: suihe1 <751183184@qq.com> Date: Thu, 25 Apr 2024 16:05:23 +0800 Subject: [PATCH] Update JavaClassUtil.java Import enum class, comment @see after writing only the class name can not find the corresponding enum --- src/main/java/com/ly/doc/utils/JavaClassUtil.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/ly/doc/utils/JavaClassUtil.java b/src/main/java/com/ly/doc/utils/JavaClassUtil.java index df39bced..aa40cedf 100644 --- a/src/main/java/com/ly/doc/utils/JavaClassUtil.java +++ b/src/main/java/com/ly/doc/utils/JavaClassUtil.java @@ -394,9 +394,7 @@ public static JavaClass getSeeEnum(JavaField javaField, ProjectDocConfigBuilder return null; } String value = see.getValue(); - if (!JavaClassValidateUtil.isClassName(value)) { - return null; - } + // not FullyQualifiedName if (!StringUtils.contains(value, ".")) { List imports = javaField.getDeclaringClass().getSource().getImports(); @@ -404,6 +402,10 @@ public static JavaClass getSeeEnum(JavaField javaField, ProjectDocConfigBuilder value = imports.stream().filter(i -> StringUtils.endsWith(i, finalValue)).findFirst().orElse(StringUtils.EMPTY); } + if (!JavaClassValidateUtil.isClassName(value)) { + return null; + } + JavaClass enumClass = builder.getJavaProjectBuilder().getClassByName(value); if (enumClass.isEnum()) { return enumClass;