java.lang.UnsupportedOperationException

List<JSONObject> collect = parseObject.collect();
ArrayList<JSONObject> arrayList = new ArrayList<JSONObject>(collect);//没有此转换会java.lang.UnsupportedOperationException 报错
if(collect.size()>0){
Collections.sort(arrayList, new Comparator<JSONObject>() {
public int compare(JSONObject o1, JSONObject o2) {
Date a=o1.getDate("op_ts");
Date b= o2.getDate("op_ts");
if (a.compareTo(b)>0) {
return 1;
} else if(a.compareTo(b)==0) {
return 0;
} else
return -1;
}
});

posted @ 2018-12-20 12:59  uuhh  阅读(1679)  评论(0编辑  收藏  举报