From 0d4bb1beecfea5a31e7ed2e79d052d8890a7e80d Mon Sep 17 00:00:00 2001 From: groundhog Date: Mon, 11 Sep 2023 21:06:57 +0800 Subject: [PATCH] =?UTF-8?q?fix(BeanUtil):=20=E5=BF=BD=E7=95=A5=E5=A4=A7?= =?UTF-8?q?=E5=B0=8F=E5=86=99=E4=B8=8E=E5=BF=BD=E7=95=A5=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E5=90=8C=E6=97=B6=E4=BD=BF=E7=94=A8=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - https://gitee.com/dromara/hutool/issues/I80FP4 - 先以原始输入判断是否忽略,后进行忽略大小写的转换 --- .../cn/hutool/core/bean/copier/BeanToBeanCopier.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/hutool-core/src/main/java/cn/hutool/core/bean/copier/BeanToBeanCopier.java b/hutool-core/src/main/java/cn/hutool/core/bean/copier/BeanToBeanCopier.java index 9c46eae43..a0374bb50 100755 --- a/hutool-core/src/main/java/cn/hutool/core/bean/copier/BeanToBeanCopier.java +++ b/hutool-core/src/main/java/cn/hutool/core/bean/copier/BeanToBeanCopier.java @@ -11,6 +11,7 @@ import java.util.Map; /** * Bean属性拷贝到Bean中的拷贝器 * + * @author Admin * @param 源Bean类型 * @param 目标Bean类型 * @since 5.8.0 @@ -53,14 +54,14 @@ public class BeanToBeanCopier extends AbsCopier { return; } - sFieldName = copyOptions.editFieldName(sFieldName); - // 对key做转换,转换后为null的跳过 - if (null == sFieldName) { + // 忽略不需要拷贝的 key, + if (false == copyOptions.testKeyFilter(sFieldName)) { return; } - // 忽略不需要拷贝的 key, - if (false == copyOptions.testKeyFilter(sFieldName)) { + sFieldName = copyOptions.editFieldName(sFieldName); + // 对key做转换,转换后为null的跳过 + if (null == sFieldName) { return; }