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


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

Re: Odd ConcurrentModificationException

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From Knute Johnson <september@knutejohnson.com>
Newsgroups comp.lang.java.programmer
Subject Re: Odd ConcurrentModificationException
Date Tue, 10 Dec 2013 13:10:01 -0800
Organization A noiseless patient Spider
Lines 22
Message-ID <l87vv2$nuf$1@dont-email.me> (permalink)
References <l87jo5$5vt$1@dont-email.me> <iterator-remove-20131210184756@ram.dialup.fu-berlin.de>
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
Injection-Date Tue, 10 Dec 2013 21:09:54 +0000 (UTC)
Injection-Info mx05.eternal-september.org; posting-host="aba33539224e5c782fe0c4053f7756fd"; logging-data="24527"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18QNl0BzrG+wXjMqQA5SBYD"
User-Agent Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.1.1
In-Reply-To <iterator-remove-20131210184756@ram.dialup.fu-berlin.de>
Cancel-Lock sha1:/C4s89aMRZtCUkRhTDp68NCUXRk=
Xref csiph.com comp.lang.java.programmer:26831

Show key headers only | 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