AbstractContext.close() throws a ConcurrentModificationException

3 views
Skip to first unread message

nkulk

unread,
May 21, 2008, 7:42:34 AM5/21/08
to osjava
Hi,

I'd like to report that AbstractContext.close() throws a
ConcurrentModificationException. This happens because it iterates over
the key set of the member table and in the loop body modifies table.
IMO this can be fixed by either iterating over a copy of the key set,
or calling remove() on the iterator.

Regards, Nils

Henri Yandell

unread,
May 25, 2008, 1:19:11 AM5/25/08
to osj...@googlegroups.com
Thanks Nils,

I've applied the change - by storing the elements to be removed in a
separate list and then removing them in a separate loop.

I went with that as I wasn't convinced that unit tests would be
testing that using the iterator.remove() was working.

Thanks for the report,

Hen

Reply all
Reply to author
Forward
0 new messages