mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix: 修复 BeanUtil#copyProperties 源对象与目标对象都是 Map 时设置忽略属性无效问题
closes #2697
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
package cn.hutool.core.bean;
|
||||
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* https://github.com/dromara/hutool/issues/2697
|
||||
*/
|
||||
public class Issue2697Test {
|
||||
|
||||
@Test
|
||||
public void mapToMapTest(){
|
||||
Map<String, String> mapA = new HashMap<>(16);
|
||||
mapA.put("12", "21");
|
||||
mapA.put("121", "21");
|
||||
mapA.put("122", "21");
|
||||
Map<String, String> mapB = new HashMap<>(16);
|
||||
BeanUtil.copyProperties(mapA, mapB, "12");
|
||||
System.out.println(mapB);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user