diff --git a/CHANGELOG.md b/CHANGELOG.md index c1ed66331..53bf50c3f 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ * 【core 】 重载subtractToList方法,提供isLinked选项(pr#3923@Github) * 【extra 】 `TemplateConfig`增加`setUseCache`方法(issue#IC3JRY@Gitee) * 【extra 】 `AbstractFtp`增加`rename`方法(issue#IC3PMI@Gitee) +* 【core 】 优化`PropDesc`缓存注解判断,提升性能(pr#1335@Gitee) ### 🐞Bug修复 * 【setting】 修复`Setting`autoLoad可能的加载为空的问题(issue#3919@Github) diff --git a/hutool-core/src/main/java/cn/hutool/core/bean/PropDesc.java b/hutool-core/src/main/java/cn/hutool/core/bean/PropDesc.java index 65e5560c3..eba279382 100644 --- a/hutool-core/src/main/java/cn/hutool/core/bean/PropDesc.java +++ b/hutool-core/src/main/java/cn/hutool/core/bean/PropDesc.java @@ -70,7 +70,10 @@ public class PropDesc { /** * 在对象的所有属性设置完成后,执行初始化逻辑。 *

- * 预先计算transient关键字和@Transient注解、{@link PropIgnore}注解信息 + * 预先计算transient关键字和@Transient注解、{@link PropIgnore}注解信息
+ * 见:https://gitee.com/chinabugotech/hutool/pulls/1335 + * + * @since 5.8.38 */ public void initialize() { transientForGet = isTransientForGet(); @@ -78,6 +81,7 @@ public class PropDesc { ignoreGet = isIgnoreGet(); ignoreSet = isIgnoreSet(); } + /** * 获取字段名,如果存在Alias注解,读取注解的值作为名称 * @@ -370,7 +374,7 @@ public class PropDesc { */ private boolean isIgnoreSet() { return AnnotationUtil.hasAnnotation(this.field, PropIgnore.class) - || AnnotationUtil.hasAnnotation(this.setter, PropIgnore.class); + || AnnotationUtil.hasAnnotation(this.setter, PropIgnore.class); } /** @@ -385,7 +389,7 @@ public class PropDesc { */ private boolean isIgnoreGet() { return AnnotationUtil.hasAnnotation(this.field, PropIgnore.class) - || AnnotationUtil.hasAnnotation(this.getter, PropIgnore.class); + || AnnotationUtil.hasAnnotation(this.getter, PropIgnore.class); } /**