Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mapl.excludeFilter方法返回的数据有重复 #818

Closed
yinshaojun opened this issue Mar 17, 2015 · 2 comments
Closed

Mapl.excludeFilter方法返回的数据有重复 #818

yinshaojun opened this issue Mar 17, 2015 · 2 comments

Comments

@yinshaojun
Copy link

    String json = "{name:'nutz', age:12, address:[{area:1,name:'abc'}, {area:2,name:'123'}]}";
    Object obj = Json.fromJson(json);

    List<String> list = new ArrayList<String>();
    list.add("age");
    list.add("address[].name");
    Object newobj = Mapl.excludeFilter(obj, list);
    System.out.println(newobj);

上面出来的是{address=[{area=1}, {area=2}], name=nutz},这是正常的。

可是,去掉list.add("address[].name");
出来的却是{address=[{area=1, name=abc}, {area=2, name=123}, {area=1, name=abc}, {area=2, name=123}], name=nutz}。

用Mapl.excludeFilter(Object maplist, List paths)进行过滤时,如果(Pojo)maplist里有属性是List时,且paths中不含对List的过滤,转为json后List会出现2次。

@wendal
Copy link
Member

wendal commented Mar 17, 2015

@junkai

@wendal
Copy link
Member

wendal commented Feb 8, 2017

废弃mapl包

@wendal wendal closed this as completed Feb 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants