602 |
|
for (int i=0; i<size; i++) |
603 |
|
s.writeObject(elementData[i]); |
604 |
|
|
605 |
< |
if (modCount != expectedModCount) { |
605 |
> |
if (expectedModCount != modCount) { |
606 |
|
throw new ConcurrentModificationException(); |
607 |
|
} |
608 |
|
|
725 |
|
} catch (IndexOutOfBoundsException ex) { |
726 |
|
throw new NoSuchElementException(); |
727 |
|
} finally { |
728 |
< |
if (modCount != expectedModCount) |
728 |
> |
if (expectedModCount != modCount) |
729 |
|
throw new ConcurrentModificationException(); |
730 |
|
} |
731 |
|
} |
733 |
|
public void remove() { |
734 |
|
if (lastRet < 0) |
735 |
|
throw new IllegalStateException(); |
736 |
< |
if (modCount != expectedModCount) |
736 |
> |
if (expectedModCount != modCount) |
737 |
|
throw new ConcurrentModificationException(); |
738 |
|
ArrayList.this.remove(lastRet); |
739 |
|
if (lastRet < cursor) |
745 |
|
public void set(E e) { |
746 |
|
if (lastRet < 0) |
747 |
|
throw new IllegalStateException(); |
748 |
< |
if (modCount != expectedModCount) |
748 |
> |
if (expectedModCount != modCount) |
749 |
|
throw new ConcurrentModificationException(); |
750 |
|
ArrayList.this.set(lastRet, e); |
751 |
|
expectedModCount = modCount; |
752 |
|
} |
753 |
|
|
754 |
|
public void add(E e) { |
755 |
< |
if (modCount != expectedModCount) |
755 |
> |
if (expectedModCount != modCount) |
756 |
|
throw new ConcurrentModificationException(); |
757 |
|
ArrayList.this.add(cursor++, e); |
758 |
|
lastRet = -1; |