commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sebb (JIRA)" <j...@apache.org>
Subject [jira] Commented: (COLLECTIONS-330) ConcurrentModificationException using remove from the keySet the LRUMap
Date Thu, 18 Jun 2009 12:51:07 GMT

    [ https://issues.apache.org/jira/browse/COLLECTIONS-330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12721235#action_12721235
] 

Sebb commented on COLLECTIONS-330:
----------------------------------

Note that this does not appear to be a threading issue - the testSynchronizedRemoveFromMapIterator
test fails even with only one thread. Similarly for testSynchronizedRemoveFromKeySet.

Perhaps there should be separate single-threaded tests - or at least, the tests should check
a single thread first before attempting multiple threads.

BTW, I added some detail to the ConcurrentModificationException, this shows that the check
that is failing is 1001!=1000 (single thread test)
i.e. the expectedModCount is one less than the parent.modCount. Looks like one of the methods
is not updating expectedModCount correctly.

> ConcurrentModificationException using remove from the keySet the LRUMap
> -----------------------------------------------------------------------
>
>                 Key: COLLECTIONS-330
>                 URL: https://issues.apache.org/jira/browse/COLLECTIONS-330
>             Project: Commons Collections
>          Issue Type: Bug
>          Components: Collection
>    Affects Versions: 3.3
>            Reporter: Joerg Schaible
>
> Even if the access to a LRUMap is synced and the remove method of the iterator is used
that has been returned from the keySet of the LRUMap, it is possible to get a ConcurrentModificationException.
This does not happen for remove of the iterators returned by the entrySet or values of the
LRUMap. See currently not executed unit test in TestLRUMap (marked as TODO for COLLECTION-3).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message