事故代码

List<Long> tagList = Arrays.asList(ArrayUtils.toObject(tagIds));
List<Long> pointIds = pointDao.findIds();
tagList.removeAll(pointIds);

这个时候报错

java.lang.UnsupportedOperationException

解决方法,加一次封装

List<Long> originalIds = Arrays.asList(ArrayUtils.toObject(tagIds));

List<Long> pointIds = pointDao.findIds();

//取差集
List<Long> tagList = new ArrayList<>(originalIds);
tagList.removeAll(pointIds);

分析

​报错原因​