diff --git a/src/main/java/com/ly/doc/builder/ProjectDocConfigBuilder.java b/src/main/java/com/ly/doc/builder/ProjectDocConfigBuilder.java index 1cb94d8d..7b846b61 100644 --- a/src/main/java/com/ly/doc/builder/ProjectDocConfigBuilder.java +++ b/src/main/java/com/ly/doc/builder/ProjectDocConfigBuilder.java @@ -342,10 +342,10 @@ private void initClassFilesMap() { ClassLoader classLoader = apiConfig.getClassLoader(); try { if (Objects.isNull(classLoader)) { - enumClass = Class.forName(cls.getFullyQualifiedName()); + enumClass = Class.forName(cls.getBinaryName()); } else { - enumClass = classLoader.loadClass(cls.getFullyQualifiedName()); + enumClass = classLoader.loadClass(cls.getBinaryName()); } enumClassMap.put(cls.getFullyQualifiedName(), enumClass); } diff --git a/src/main/java/com/ly/doc/helper/ParamsBuildHelper.java b/src/main/java/com/ly/doc/helper/ParamsBuildHelper.java index 7ddf07f2..c1762020 100644 --- a/src/main/java/com/ly/doc/helper/ParamsBuildHelper.java +++ b/src/main/java/com/ly/doc/helper/ParamsBuildHelper.java @@ -823,7 +823,7 @@ public static String handleEnumComment(JavaClass javaClass, ProjectDocConfigBuil String enumComments = javaClass.getComment(); if (Boolean.TRUE.equals(projectBuilder.getApiConfig().getInlineEnum())) { ApiDataDictionary dataDictionary = projectBuilder.getApiConfig() - .getDataDictionary(javaClass.getCanonicalName()); + .getDataDictionary(javaClass.getBinaryName()); if (Objects.isNull(dataDictionary)) { // the output format should be unified ( as same as the "else" output) comment = comment + "
[Enum: " + JavaClassUtil.getEnumParams(javaClass) + "]"; @@ -833,7 +833,7 @@ public static String handleEnumComment(JavaClass javaClass, ProjectDocConfigBuil if (enumClass.isInterface()) { ClassLoader classLoader = projectBuilder.getApiConfig().getClassLoader(); try { - enumClass = classLoader.loadClass(javaClass.getFullyQualifiedName()); + enumClass = classLoader.loadClass(javaClass.getBinaryName()); } catch (ClassNotFoundException e) { return comment; diff --git a/src/main/java/com/ly/doc/utils/DocUtil.java b/src/main/java/com/ly/doc/utils/DocUtil.java index 706c62da..a654712a 100644 --- a/src/main/java/com/ly/doc/utils/DocUtil.java +++ b/src/main/java/com/ly/doc/utils/DocUtil.java @@ -1181,7 +1181,7 @@ public static List buildDictionary(ApiConfig config, JavaProjectBuil } for (Class> enumClass : enumImplementSet) { - JavaClass javaClass = javaProjectBuilder.getClassByName(enumClass.getCanonicalName()); + JavaClass javaClass = javaProjectBuilder.getClassByName(enumClass.getName()); if (Objects.nonNull(javaClass.getTagByName(DocTags.IGNORE))) { continue; } diff --git a/src/main/java/com/ly/doc/utils/JavaClassUtil.java b/src/main/java/com/ly/doc/utils/JavaClassUtil.java index d4b12482..5b3f3dd8 100644 --- a/src/main/java/com/ly/doc/utils/JavaClassUtil.java +++ b/src/main/java/com/ly/doc/utils/JavaClassUtil.java @@ -419,10 +419,10 @@ private static Class loadEnumClass(JavaClass javaClass, ProjectDocConfigBuild ClassLoader classLoader = apiConfig.getClassLoader(); try { if (Objects.nonNull(classLoader)) { - return classLoader.loadClass(javaClass.getFullyQualifiedName()); + return classLoader.loadClass(javaClass.getBinaryName()); } else { - return Class.forName(javaClass.getFullyQualifiedName()); + return Class.forName(javaClass.getBinaryName()); } } catch (ClassNotFoundException e) { @@ -605,7 +605,7 @@ public static EnumInfo getEnumInfo(JavaClass javaClass, ProjectDocConfigBuilder ApiConfig apiConfig = builder.getApiConfig(); ClassLoader classLoader = apiConfig.getClassLoader(); - ApiDataDictionary dataDictionary = apiConfig.getDataDictionary(javaClass.getFullyQualifiedName()); + ApiDataDictionary dataDictionary = apiConfig.getDataDictionary(javaClass.getBinaryName()); EnumInfo enumInfo = new EnumInfo(); String comment = javaClass.getComment(); @@ -620,7 +620,7 @@ public static EnumInfo getEnumInfo(JavaClass javaClass, ProjectDocConfigBuilder Class enumClass = dataDictionary.getEnumClass(); if (enumClass.isInterface()) { try { - enumClass = classLoader.loadClass(javaClass.getFullyQualifiedName()); + enumClass = classLoader.loadClass(javaClass.getBinaryName()); } catch (ClassNotFoundException e) { return enumInfo; @@ -1120,10 +1120,10 @@ private static String getFieldGenericType(JavaField javaField, ClassLoader class try { Class c; if (Objects.nonNull(classLoader)) { - c = classLoader.loadClass(javaField.getDeclaringClass().getCanonicalName()); + c = classLoader.loadClass(javaField.getDeclaringClass().getBinaryName()); } else { - c = Class.forName(javaField.getDeclaringClass().getCanonicalName()); + c = Class.forName(javaField.getDeclaringClass().getBinaryName()); } Field f = c.getDeclaredField(name); f.setAccessible(true); diff --git a/src/main/java/com/ly/doc/utils/JavaFieldUtil.java b/src/main/java/com/ly/doc/utils/JavaFieldUtil.java index 99b7f3e5..f019bb27 100644 --- a/src/main/java/com/ly/doc/utils/JavaFieldUtil.java +++ b/src/main/java/com/ly/doc/utils/JavaFieldUtil.java @@ -204,10 +204,10 @@ public static String getConstantsFieldValue(ClassLoader classLoader, JavaClass j try { Class c; if (Objects.nonNull(classLoader)) { - c = classLoader.loadClass(javaClass.getFullyQualifiedName()); + c = classLoader.loadClass(javaClass.getBinaryName()); } else { - c = Class.forName(javaClass.getFullyQualifiedName()); + c = Class.forName(javaClass.getBinaryName()); } Field[] fields = c.getDeclaredFields(); for (Field f : fields) {