Skip to content

Commit f593525

Browse files
committed
Update IterAndListIterT.java
1 parent 9a7082a commit f593525

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/org/javacore/collection/util/IterAndListIterT.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@ public static void main(String[] args) {
3535

3636
/**
3737
* 并发修改异常产生。
38-
* 原因:Iterator(Object obj = it.next()) 会检查HashMap的size,
38+
* 原因:Iterator(Object obj = it.next())里会用checkForComodification检查HashMap的size
39+
* if (modCount != expectedModCount) {
40+
* throw new ConcurrentModificationException();
41+
* }
3942
* size发生变化,抛出错误ConcurrentModificationException。
4043
*/
4144
@SuppressWarnings({ "unchecked", "rawtypes" })

0 commit comments

Comments
 (0)