Project: Eclipse_Platform_UI
Bug 70828 [ProblemsView] ConcurrentModificationException is thrown when gotoMarker is called.
Reported: 2004-07-26 11:15:24 | Status: closed fixed

When a problem marker is clicked on ProblemView, the workbench throws ConcurrentModificationException exception. Here is how to. 1) Unzip the attached plugin. This is created from a sample multipage editor. 2) Create a Java project, and create a sample java file which has a problem. So that you see a problem on ProblemView 3) Open that java file by Sample multi-page editor 4) Click the problem on ProblemView. So you will see "An error has occured. See error log for more detail" window. The .log has : java.util.ConcurrentModificationException at java.util.AbstractList$Itr.checkForComodification(AbstractList.java:456) at java.util.AbstractList$Itr.next(AbstractList.java:429) at org.eclipse.ui.views.markers.internal.SelectionProviderAdapter.setSelection(SelectionProviderAdapter.java:48) at org.eclipse.ui.views.markers.internal.TableView.setSelection(TableView.java:182) at org.eclipse.ui.views.markers.internal.MarkerView.viewerSelectionChanged(MarkerView.java:316) at org.eclipse.ui.views.markers.internal.TableView$1.selectionChanged(TableView.java:133) at org.eclipse.jface.viewers.Viewer$2.run(Viewer.java:159) at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:615) at org.eclipse.core.runtime.Platform.run(Platform.java:747) at org.eclipse.jface.viewers.Viewer.fireSelectionChanged(Viewer.java:157) at org.eclipse.jface.viewers.StructuredViewer.updateSelection(StructuredViewer.java:1394) at org.eclipse.jface.viewers.StructuredViewer.handleSelect(StructuredViewer.java:693) at org.eclipse.jface.viewers.StructuredViewer$4.widgetSelected(StructuredViewer.java:718) at org.eclipse.jface.util.OpenStrategy.fireSelectionEvent(OpenStrategy.java:180) at org.eclipse.jface.util.OpenStrategy.access$3(OpenStrategy.java:175) at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:324) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:796) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2772) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2431) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1377) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1348) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:254) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:141) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:96) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:335) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:273) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:129) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:41) at java.lang.reflect.Method.invoke(Method.java:386) at org.eclipse.core.launcher.Main.basicRun(Main.java:183) at org.eclipse.core.launcher.Main.run(Main.java:644) at org.eclipse.core.launcher.Main.main(Main.java:628) Looks like this is because SelectionProviderAdapter#setSelection() does : theSelection = selection; SelectionChangedEvent e = new SelectionChangedEvent(this, selection); Iterator iter = listeners.iterator(); while (iter.hasNext()) { ISelectionChangedListener next = (ISelectionChangedListener)iter.next(); next.selectionChanged(e); } but during a call to 'next.selectionChanged()', sombody calls its add/removeSelectionChangedListener() which causes this exception.

Files changed in fix:
bundles/org.eclipse.ui.ide/src/org/eclipse/ui/views/markers/internal/SelectionProviderAdapter.java