最近在项目中遇到一个异常,ConcurrentModificationException,造成问题的原因是因为我通过ArrayList的对象进行remove操作,具体问题代码如下:
/**
* 跟进人列表去重
*
* @Param followUpUserInfoVOList
* @return void
* @throws Exception
* @author zhangzhixiang
* @data 2019/03/14 11:30:59
*/
public static void repeatRemove(List<FollowUpUserInfoVO> followUpUserINfoVOList){
Set<String> hashCodeSet = Sets.newHashSet();
StringBuilder uniqueBuilder = new StringBuilder();
for (FollowUpUserInfoVO follow : followUpUserINfoVOList) {
uniqueBuilder.append(follow.getUserAccount).append(",");
uniqueBuilder.append(follow.getUserName).append(",");
uniqueBuilder.app