问题:list通过增强for循环或者for循环又或者流形式遍历会导致 outofsize 下标越界问题
解决方式:通过迭代方式实现
实现:
//遍历明细标签:遍历,元素,list,remove,xxxDetail,XxxDetail,phoneNo From: https://www.cnblogs.com/yushizhang/p/16822002.html
Iterator<UserGroupDetail> it = userGroupDetails.iterator();
while(it.hasNext()){
XxxDetail xxxDetail = it.next();
XxxDetail xxxDetail = JSON.parseObject(xxxDetail.getXxxInfo(),XxxDetail.class);
String phoneNo = xxxDetail.getPhone();
//匹配黑名单 存在则进行删除
if (ObjectUtils.isNotEmpty(bLMap.get(phoneNo))) {
it.remove();
}
}