Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #26831

Re: Odd ConcurrentModificationException

From Knute Johnson <september@knutejohnson.com>
Newsgroups comp.lang.java.programmer
Subject Re: Odd ConcurrentModificationException
Date 2013-12-10 13:10 -0800
Organization A noiseless patient Spider
Message-ID <l87vv2$nuf$1@dont-email.me> (permalink)
References <l87jo5$5vt$1@dont-email.me> <iterator-remove-20131210184756@ram.dialup.fu-berlin.de>

Show all headers | View raw


On 12/10/2013 9:49 AM, Stefan Ram wrote:
> Knute Johnson <september@knutejohnson.com> writes:
>> I'm getting an odd ConcurrentModificationException in a MouseListener
>> when I try to remove an element from an ArrayList.  The really strange
> ...
>>              for (DisplayBox box : boxes) {
> ...
>>                      boxes.remove(box);
>
>    This is an FAQ. Try using the iterator directly and then use Iterator#remove.
>

Stefan:

I don't know why my previous reply didn't show up but you are correct, I 
am seriously confused.  But your reply did allow me to correct my problem.

Thanks,

-- 

Knute Johnson

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Odd ConcurrentModificationException Knute Johnson <september@knutejohnson.com> - 2013-12-10 09:41 -0800
  Re: Odd ConcurrentModificationException Eric Sosman <esosman@comcast-dot-net.invalid> - 2013-12-10 14:22 -0500
  Re: Odd ConcurrentModificationException Knute Johnson <september@knutejohnson.com> - 2013-12-10 13:10 -0800

csiph-web