[
https://issues.apache.org/jira/browse/CURATOR-131?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14081498#comment-14081498
]
ASF GitHub Bot commented on CURATOR-131:
----------------------------------------
GitHub user madrob opened a pull request:
https://github.com/apache/curator/pull/29
CURATOR-131 use iterator.remove instead of foreach
When iterating over a collection, if we try to remove elements that
can lead to undefined behaviour. We should use an iterator and its
remove method to do this safely.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/madrob/curator CURATOR-131
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/curator/pull/29.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #29
----
commit e38d1ceda492e097ad9c94bb854838f2b1f7caa9
Author: Mike Drob <[email protected]>
Date: 2014-07-31T21:24:40Z
CURATOR-131 use iterator.remove instead of foreach
When iterating over a collection, if we try to remove elements that
can lead to undefined behaviour. We should use an iterator and its
remove method to do this safely.
----
> Should not modify collection while iterating over it
> ----------------------------------------------------
>
> Key: CURATOR-131
> URL: https://issues.apache.org/jira/browse/CURATOR-131
> Project: Apache Curator
> Issue Type: Bug
> Reporter: Mike Drob
> Assignee: Jordan Zimmerman
> Priority: Minor
> Fix For: 2.7.0
>
>
> A couple of places in the code attempt to remove elements from a map while
> iterating over it, but without using the iterator. This can lead to undefined
> behaviour including skipping elements, repeating elements, or
> ConcurrentModificationException thrown.
> Static analysis tools can help spot these locations.
--
This message was sent by Atlassian JIRA
(v6.2#6252)