Skip to content

Commit

Permalink
修复CopyOptions.setIgnoreCase和setIgnoreProperties冲突问题
Browse files Browse the repository at this point in the history
  • Loading branch information
looly committed Sep 12, 2023
1 parent 8c4b126 commit 6ad0a55
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
* 【core 】 修复Tailer stop NPE问题(pr#1067@Gitee)
* 【json 】 修复toJSONString导致CPU使用率高的问题(issue#3297@Github)
* 【core 】 修复NumberUtil.parseInt 16进制解析错误的问题(pr#1071@Gitee)
* 【core 】 修复CopyOptions.setIgnoreCase和setIgnoreProperties冲突问题(issue#I80FP4@Gitee)

-------------------------------------------------------------------------------------------------------------
# 5.8.21(2023-07-29)
Expand Down
12 changes: 12 additions & 0 deletions hutool-core/src/test/java/cn/hutool/core/bean/IssueI80FP4Test.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,18 @@ public void copyPropertiesTest() {
Assert.assertNull(dest.getEnderDest());
}

@Test
public void copyPropertiesTest2() {
final Dest sourceDest = new Dest();
sourceDest.setCPF(33699);
sourceDest.setEnderDest("abc");

final Dest dest = new Dest();
final CopyOptions copyOptions = CopyOptions.create().setIgnoreNullValue(true).setIgnoreCase(true).setIgnoreProperties("enderdest");
BeanUtil.copyProperties(sourceDest, dest, copyOptions);
Assert.assertNull(dest.getEnderDest());
}

@Data
static class Dest{
private int cPF;
Expand Down

0 comments on commit 6ad0a55

Please sign in to comment.