felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Guillaume Nodet (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (FELIX-3416) ConcurrentModificationException in DirectoryWatcher.findBundlesWithFragmentsToRefresh
Date Mon, 11 Jun 2012 15:24:42 GMT

     [ https://issues.apache.org/jira/browse/FELIX-3416?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Guillaume Nodet resolved FELIX-3416.
------------------------------------

       Resolution: Fixed
    Fix Version/s: fileinstall-3.2.4
         Assignee: Guillaume Nodet

URL: http://svn.apache.org/viewvc?rev=1348901&view=rev

                
> ConcurrentModificationException in DirectoryWatcher.findBundlesWithFragmentsToRefresh
> -------------------------------------------------------------------------------------
>
>                 Key: FELIX-3416
>                 URL: https://issues.apache.org/jira/browse/FELIX-3416
>             Project: Felix
>          Issue Type: Bug
>          Components: File Install
>    Affects Versions: fileinstall-3.2.0
>            Reporter: Matt Magoffin
>            Assignee: Guillaume Nodet
>             Fix For: fileinstall-3.2.4
>
>
> I recently upgraded to File Install 3.2.0, and while testing an application came across
this exception:
> In main loop, we have serious trouble: java.util.ConcurrentModificationException
> java.util.ConcurrentModificationException
>         at java.util.HashMap$HashIterator.nextEntry(HashMap.java:793)
>         at java.util.HashMap$KeyIterator.next(HashMap.java:828)
>         at org.apache.felix.fileinstall.internal.DirectoryWatcher.findBundlesWithFragmentsToRefresh(DirectoryWatcher.java:1247)
>         at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:475)
>         at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:286)
> Looking at the code, in the findBundlesWithFragmentsToRefresh() method, I see it iterates
over a set while adding to the set, which violates the contract of the java.util.HashSet instance
passed into the method:
> protected void findBundlesWithFragmentsToRefresh(Set toRefresh) {
>   for (Iterator iterator = toRefresh.iterator(); iterator.hasNext();) {
>     ...
>     toRefresh.add(hostBundle);
>   }
> }
> Perhaps a temporary Set is needed within the iteration, so the found bundles can be added
to the toRefresh set after the iteration loop?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message