java中遇到的恶心异常java.util.ConcurrentModificationException

1,单线程下遇到的场景:在foreach遍历中,使用list.remove(对象)抛异常   list.forEach(orderItemEntity -> {     if (orderItemEntity.getProductId().equals(productId)){         list.remove(orderItemEntity);     } }) 产生的原因:    看一下
相关文章
相关标签/搜索