Bean copy - missing map inner structure when filter applied
Closed this issue · 0 comments
greenlaw110 commented
Sample code:
public class Gh202 extends TestBase {
public static class Bean {
public Map<String, Object> map;
public String name;
}
@Test
public void test() {
Bean bean = new Bean();
Map<String, Object> innerMap = C.Map("count", 1);
bean.map = C.Map("foo", "bar", "inner", innerMap);
bean.name = S.random();
Bean target = $.deepCopy(bean).filter("map").to(Bean.class);
Map<String, Object> innerMap2 = $.cast(target.map.get("inner"));
notNull(innerMap2);
eq(1, innerMap2.get("count"));
}
}
Running the above code and the test fail at the eq(1, innerMap2.get("count"));
line: