代码按照网上修改为类似,还不能解决问题

for (Iterator<String> it = target.keySet().iterator(); it.hasNext(); ) {
  if(...)
   it.remove();
}

,后来根据异常名称,推测是在Servlet多线程环境下保持,换成并发ConcurrentHashMap就解决问题了。

 

 

参考:

HashMap报错:java.util.ConcurrentModificationException

相关文章:

  • 2022-01-08
  • 2022-02-16
  • 2021-10-15
  • 2021-04-07
  • 2022-01-09
  • 2022-02-22
  • 2022-02-20
  • 2021-11-06
猜你喜欢
  • 2021-07-25
  • 2021-06-03
  • 2022-12-23
  • 2021-06-08
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案