Community
Participate
Working Groups
OSX 10.6.3 Eclipse SDK M6, osx-cocoa-64 with I-Build 20100414 today I had it some times that resetting the target platform causes exceptions (preferences - target platform - reload - OK at first I got a ConcurrentModificationException: java.util.ConcurrentModificationException at java.util.HashMap$HashIterator.nextEntry(HashMap.java:793) at java.util.HashMap$ValueIterator.next(HashMap.java:822) at java.util.AbstractCollection.toArray(AbstractCollection.java:171) at org.eclipse.core.internal.registry.ExtensionRegistry.getAllContributors(ExtensionRegistry.java:1358) at org.eclipse.pde.internal.core.PDERegistryStrategy$ModelListener.modelsChanged(PDERegistryStrategy.java:80) at org.eclipse.pde.internal.core.PluginModelManager.fireDelta(PluginModelManager.java:314) at org.eclipse.pde.internal.core.PluginModelManager.modelsChanged(PluginModelManager.java:225) at org.eclipse.pde.internal.core.PluginModelManager.resetState(PluginModelManager.java:984) at org.eclipse.pde.internal.core.TargetPlatformResetJob.run(TargetPlatformResetJob.java:39) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) restarted eclipse, did the same this time it works. did some more tests - then I got a ArrayIndexOutOfBoundsException: java.lang.ArrayIndexOutOfBoundsException: 8 at org.eclipse.core.internal.registry.ExtensionRegistry.removeExtension(ExtensionRegistry.java:598) at org.eclipse.core.internal.registry.ExtensionRegistry.removeExtensionsAndExtensionPoints(ExtensionRegistry.java:625) at org.eclipse.core.internal.registry.ExtensionRegistry.basicRemove(ExtensionRegistry.java:241) at org.eclipse.core.internal.registry.ExtensionRegistry.remove(ExtensionRegistry.java:570) at org.eclipse.core.internal.registry.ExtensionRegistry.removeContributor(ExtensionRegistry.java:555) at org.eclipse.pde.internal.core.PDERegistryStrategy$ModelListener.modelsChanged(PDERegistryStrategy.java:83) at org.eclipse.pde.internal.core.PluginModelManager.fireDelta(PluginModelManager.java:314) at org.eclipse.pde.internal.core.PluginModelManager.modelsChanged(PluginModelManager.java:225) at org.eclipse.pde.internal.core.PluginModelManager.resetState(PluginModelManager.java:984) at org.eclipse.pde.internal.core.TargetPlatformResetJob.run(TargetPlatformResetJob.java:39) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
BTW: I did my tests with reloading Target Platforms because I worked on description of Bug 309795 which causes me always to reload the Target Platform after restarting eclipse and I wanted to test it again in a new installation.
using SDK 3.6 RC1 - from time to time I'm still getting these exceptions while resetting the target platform. trying again it mostly works. java.util.ConcurrentModificationException at java.util.HashMap$HashIterator.nextEntry(HashMap.java:793) at java.util.HashMap$ValueIterator.next(HashMap.java:822) at java.util.AbstractCollection.toArray(AbstractCollection.java:171) at org.eclipse.core.internal.registry.ExtensionRegistry.getAllContributors(ExtensionRegistry.java:1358) at org.eclipse.pde.internal.core.PDERegistryStrategy$ModelListener.modelsChanged(PDERegistryStrategy.java:80) at org.eclipse.pde.internal.core.PluginModelManager.fireDelta(PluginModelManager.java:355) at org.eclipse.pde.internal.core.PluginModelManager.modelsChanged(PluginModelManager.java:255) at org.eclipse.pde.internal.core.PluginModelManager.resetState(PluginModelManager.java:1042) at org.eclipse.pde.internal.core.TargetPlatformResetJob.run(TargetPlatformResetJob.java:39) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
*** Bug 375945 has been marked as a duplicate of this bug. ***
I am wasting hours to try to recover from this failure. Very annoying!
It looks like not all accesses to getContributors() are synchronized. For example, org.eclipse.core.internal.registry.ExtensionRegistry#getAllContributors() accesses the contributors. It looks like org.eclipse.core.internal.registry.RegistryObjectManager.getContributors() is not synchronized when other accesses to the contributor collection are. Isn't this inconsistent ?
Moving to Equinox for comment. RegistryObjectManager synchronizes getContributor(String id) but not getContributors(). getContributor also checks if the contributor is marked as removed, while getContributors() does not. PDE only uses the method in a single location (MPDERegistryStrategy). We get the list of contributors and remove a contributor that has a name match to a removed PDE model.
Oleg, can you have a look?
Don't know if this is related, but I get this stack trace in the error log when running juno m6: java.util.ConcurrentModificationException at java.util.HashMap$HashIterator.nextEntry(HashMap.java:793) at java.util.HashMap$ValueIterator.next(HashMap.java:822) at org.eclipse.ui.internal.registry.WorkingSetRegistry.getUpdaterDescriptorsForNamespace(WorkingSetRegistry.java:159) at org.eclipse.ui.internal.AbstractWorkingSetManager.bundleChanged(AbstractWorkingSetManager.java:672) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:847) at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)
Hmmm... looking at it in more detail it looks like platform UI, sorry for bothering you here... Will take a look in the platform UI area...
I added a synchronization which should help. Note that I can not reproduce the problem so I can't really verify if it is fixed or not. Git reference: http://git.eclipse.org/c/equinox/rt.equinox.bundles.git/commit/?id=b5bbb5ebdec5295187718a43e1de06dd5d5e547a Tentatively marking as fixed, please reopen if you get this again on builds >= 20120428.
My team are regularly getting a java.util.ConcurrentModificationException when setting an updated target platform. It seems to happen when the target is reloaded, and the "Apply" followed by the "OK" buttons are pressed (resulting in two jobs being scheduled). Should this be raised as a new bug? Stack trace: java.util.ConcurrentModificationException at java.util.ArrayList$Itr.checkForComodification(Unknown Source) at java.util.ArrayList$Itr.next(Unknown Source) at org.eclipse.pde.internal.core.RequiredPluginsClasspathContainer.computePluginEntries(RequiredPluginsClasspathContainer.java:117) at org.eclipse.pde.internal.core.RequiredPluginsClasspathContainer.getClasspathEntries(RequiredPluginsClasspathContainer.java:95) at org.eclipse.jdt.internal.core.ClasspathEntry.validateClasspathEntry(ClasspathEntry.java:1959) at org.eclipse.jdt.internal.core.ClasspathEntry.validateClasspathEntry(ClasspathEntry.java:1908) at org.eclipse.jdt.internal.core.ClasspathValidation.validate(ClasspathValidation.java:72) at org.eclipse.jdt.internal.core.ChangeClasspathOperation.classpathChanged(ChangeClasspathOperation.java:51) at org.eclipse.jdt.internal.core.SetContainerOperation.executeOperation(SetContainerOperation.java:110) at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:728) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2345) at org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:793) at org.eclipse.jdt.core.JavaCore.setClasspathContainer(JavaCore.java:5401) at org.eclipse.pde.internal.core.PluginModelManager.updateAffectedEntries(PluginModelManager.java:373) at org.eclipse.pde.internal.core.PluginModelManager.modelsChanged(PluginModelManager.java:282) at org.eclipse.pde.internal.core.PluginModelManager.resetState(PluginModelManager.java:1075) at org.eclipse.pde.core.target.LoadTargetDefinitionJob.performPlatformReset(LoadTargetDefinitionJob.java:607) at org.eclipse.pde.core.target.LoadTargetDefinitionJob.handleReload(LoadTargetDefinitionJob.java:584) at org.eclipse.pde.core.target.LoadTargetDefinitionJob.loadPlugins(LoadTargetDefinitionJob.java:310) at org.eclipse.pde.core.target.LoadTargetDefinitionJob.runInWorkspace(LoadTargetDefinitionJob.java:143) at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
(In reply to James Fry from comment #11) > My team are regularly getting a java.util.ConcurrentModificationException > when setting an updated target platform. It seems to happen when the target > is reloaded, and the "Apply" followed by the "OK" buttons are pressed > (resulting in two jobs being scheduled). > > Should this be raised as a new bug? > > Stack trace: > > java.util.ConcurrentModificationException > at java.util.ArrayList$Itr.checkForComodification(Unknown Source) > at java.util.ArrayList$Itr.next(Unknown Source) > at > org.eclipse.pde.internal.core.RequiredPluginsClasspathContainer. > computePluginEntries(RequiredPluginsClasspathContainer.java:117) This should be a new bug opened against PDE->Core.
(In reply to James Fry from comment #11) > java.util.ConcurrentModificationException > at java.util.ArrayList$Itr.checkForComodification(Unknown Source) > at java.util.ArrayList$Itr.next(Unknown Source) > at This is Bug 409401, fixed in 4.4 M1.