diff --git a/README.md b/README.md
index 4cdd0d5..e5423b7 100644
--- a/README.md
+++ b/README.md
@@ -36,11 +36,8 @@ Toolkit
更新
----
-## [v1.1.1](https://github.com/liuzhihang/toolkit/releases/tag/v1.1.3) (2021-06-08)
-- fix:空 JsonArray 的 bug
-
-[查看更多历史更新记录](https://github.com/liuzhihang/toolkit/releases)
+[查看历史更新记录](https://github.com/liuzhihang/toolkit/releases)
关于我
----
diff --git a/build.gradle b/build.gradle
index 9c8bfea..612371f 100644
--- a/build.gradle
+++ b/build.gradle
@@ -4,7 +4,7 @@ plugins {
}
group 'com.liuzhihang.toolkit'
-version '1.1.3'
+version '1.1.4'
JavaVersion.VERSION_11
diff --git a/parts/changeNotes.html b/parts/changeNotes.html
index 1914694..8619dc9 100644
--- a/parts/changeNotes.html
+++ b/parts/changeNotes.html
@@ -3,18 +3,18 @@
English introduction
- - 1.1.3
+
- 1.1.4
- - fix bug with empty JsonArray
+ - Parameter recursive reference exception repair
- More records
中文介绍
- - 1.1.3
+
- 1.1.4
- - fix:空 JsonArray 的 bug
+ - 参数递归引用异常修复
- 更多记录
diff --git a/src/main/java/com/liuzhihang/toolkit/utils/FieldsPsiUtils.java b/src/main/java/com/liuzhihang/toolkit/utils/FieldsPsiUtils.java
index f33caa1..937233c 100644
--- a/src/main/java/com/liuzhihang/toolkit/utils/FieldsPsiUtils.java
+++ b/src/main/java/com/liuzhihang/toolkit/utils/FieldsPsiUtils.java
@@ -20,83 +20,148 @@ public class FieldsPsiUtils {
@NotNull
public static Map getFieldsAndDefaultValue(PsiClass psiClass, PsiType[] genericArr) {
+ return getFieldsAndDefaultValue(psiClass, genericArr, new LinkedList<>());
+ }
+
+ /**
+ * @param psiClass
+ * @param genericArr
+ * @param qualifiedNameList 根节点到当前节点的链表
+ * @return
+ */
+ public static Map getFieldsAndDefaultValue(PsiClass psiClass, PsiType[] genericArr, LinkedList qualifiedNameList) {
+
Map fieldMap = new LinkedHashMap<>();
- // Map commentFieldMap = new LinkedHashMap<>();
- if (psiClass != null && !psiClass.isEnum() && !psiClass.isInterface() && !psiClass.isAnnotationType()) {
- for (PsiField field : psiClass.getAllFields()) {
+ if (psiClass == null || psiClass.isEnum() || psiClass.isInterface() || psiClass.isAnnotationType()) {
+ return fieldMap;
+ }
- if (field.getModifierList() != null && field.getModifierList().hasModifierProperty(PsiModifier.STATIC)) {
- continue;
- }
+ // 设置当前类的类型
+ qualifiedNameList.add(psiClass.getQualifiedName());
- PsiType type = field.getType();
- String name = field.getName();
- // 判断注解 javax.annotation.Resource org.springframework.beans.factory.annotation.Autowired
- PsiAnnotation[] annotations = field.getAnnotations();
- if (annotations.length > 0 && containsAnnotation(annotations)) {
- fieldMap.put(name, "");
- } else if (type instanceof PsiPrimitiveType) {
- // 基本类型
- fieldMap.put(name, PsiTypesUtil.getDefaultValue(type));
- } else {
- //reference Type
- String fieldTypeName = type.getPresentableText();
- // 指定的类型
- if (Constants.FIELD_TYPE.containsKey(fieldTypeName)) {
- fieldMap.put(name, Constants.FIELD_TYPE.get(fieldTypeName));
- } else if (type instanceof PsiArrayType) {
- //array type
- List