博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
java.util.ConcurrentModificationException一次报错排查
阅读量:4170 次
发布时间:2019-05-26

本文共 351 字,大约阅读时间需要 1 分钟。

最近遇到了这个报错,报错的原因在于调用了ArrayList的sort方法,查看代码之后发现,sort方法也会改变modCount的值。后续需要注意。

@Override@SuppressWarnings("unchecked")public void sort(Comparator
c) { final int expectedModCount = modCount; Arrays.sort((E[]) elementData, 0, size, c); if (modCount != expectedModCount) { throw new ConcurrentModificationException(); } modCount++;}

 

转载地址:http://wlyai.baihongyu.com/

你可能感兴趣的文章
Unable to use IEC module under PortablePython_1.1_py2.5.4
查看>>
实用英文地址书写格式
查看>>
在oracle中通过connect by prior来实现递归查询!
查看>>
百度空间如何才能另存为 mht
查看>>
ORACLE 中ROWNUM用法总结! (转)
查看>>
如何更新ARXSGPO.xml
查看>>
Unable To View Status Diagram [ID 746806.1]
查看>>
Accounting 里的Debit 和 credit是如何区分的。。。
查看>>
10gR1中ora-00201,ora-01103错误的解决办法
查看>>
Oracle用户权限管理
查看>>
EdtiPlus-最好用的文本编辑器+使用技巧集萃
查看>>
oracle merge into 用法详解
查看>>
What is the difference between a pack slip and a pick slip?
查看>>
CSS基础
查看>>
How to Reset or Change Microsoft Office 2007 Product License Key or Volume License Key (VLK)
查看>>
使用java concurrent调用xmlp api生成pdf
查看>>
这个sql咋写?
查看>>
SQL to inspect form personalization
查看>>
A Simple Example of Weak Ref Cursor
查看>>
trap or bug when using CONTINUE in Oracle 11g
查看>>