java.util.ConcurrentModificationException when reopening a file
Migrated from http://lampsvn.epfl.ch/trac/scala/ticket/558
Reporter dragos
Closing and reopening a file sometimes results in this exception (and no editor is available for that file anymore):
Reporter dragos
Closing and reopening a file sometimes results in this exception (and no editor is available for that file anymore):
java.util.ConcurrentModificationException
at java.util.LinkedHashMap$LinkedHashIterator.nextEntry(LinkedHashMap.java:373)
at java.util.LinkedHashMap$EntryIterator.next(LinkedHashMap.java:392)
at java.util.LinkedHashMap$EntryIterator.next(LinkedHashMap.java:391)
at scala.collection.jcl.MapWrapper$IteratorWrapper.next(MapWrapper.scala:54)
at scala.collection.jcl.MapWrapper$IteratorWrapper.next(MapWrapper.scala:49)
at scala.Iterator$class.foreach(Iterator.scala:387)
at scala.collection.jcl.MapWrapper$IteratorWrapper.foreach(MapWrapper.scala:49)
at scala.Iterable$class.foreach(Iterable.scala:256)
at scala.collection.jcl.LinkedHashMap.foreach(LinkedHashMap.scala:18)
at scala.tools.nsc.symtab.IdeSupport$class.finishTyping(IdeSupport.scala:174)
at scala.tools.eclipse.ScalaPlugin$ProjectImpl$compiler0$.scala$tools$editor$Typers$Compiler$$super$finishTyping(ScalaPlugin.scala:123)
at scala.tools.editor.Typers$Compiler$class.finishTyping(Typers.scala:24)
at scala.tools.eclipse.ScalaPlugin$ProjectImpl$compiler0$.finishTyping(ScalaPlugin.scala:123)
at scala.tools.editor.TypersPresentations$ProjectImpl$$anonfun$scala$tools$editor$TypersPresentations$ProjectImpl$$loadSource$1.apply(TypersPresentations.scala:135)
at scala.tools.editor.TypersPresentations$ProjectImpl$$anonfun$scala$tools$editor$TypersPresentations$ProjectImpl$$loadSource$1.apply(TypersPresentations.scala:132)
at lampion.presentation.Presentations$ProjectImpl$class.lockTyper(Presentations.scala:308)
at scala.tools.eclipse.Driver$Project.lockTyper(Driver.scala:10)
at scala.tools.editor.TypersPresentations$ProjectImpl$class.scala$tools$editor$TypersPresentations$ProjectImpl$$loadSource(TypersPresentations.scala:132)
at scala.tools.editor.TypersPresentations$ProjectImpl$FileImpl$TokenImpl$class.asSymbol(TypersPresentations.scala:334)
at scala.tools.editor.Driver$ProjectImpl$FileImpl$Token.asSymbol(Driver.scala:25)
at scala.tools.editor.TypersPresentations$ProjectImpl$FileImpl$TokenImpl$class.style(TypersPresentations.scala:347)
at scala.tools.editor.Driver$ProjectImpl$FileImpl$Token.style(Driver.scala:25)
at lampion.presentation.Presentations$ProjectImpl$FileImpl$class.refreshHighlightFor(Presentations.scala:116)
at scala.tools.eclipse.Driver$Project$File.refreshHighlightFor(Driver.scala:13)
at lampion.eclipse.UIPlugin$ProjectImpl$FileImpl$class.refresh(UIPlugin.scala:184)
at scala.tools.eclipse.Driver$Project$File.refresh(Driver.scala:13)
at lampion.eclipse.SourceViewer$reconciler$.createPresentation(SourceViewer.scala:56)
at org.eclipse.jface.text.presentation.PresentationReconciler.createPresentation(PresentationReconciler.java:453)
at org.eclipse.jface.text.presentation.PresentationReconciler.processDamage(PresentationReconciler.java:567)
at org.eclipse.jface.text.presentation.PresentationReconciler.access$3(PresentationReconciler.java:565)
at org.eclipse.jface.text.presentation.PresentationReconciler$InternalListener.inputDocumentChanged(PresentationReconciler.java:119)
at org.eclipse.jface.text.TextViewer.fireInputDocumentChanged(TextViewer.java:2685)
at org.eclipse.jface.text.TextViewer.setDocument(TextViewer.java:2734)
at org.eclipse.jface.text.source.SourceViewer.setDocument(SourceViewer.java:518)
at org.eclipse.jface.text.source.projection.ProjectionViewer.setDocument(ProjectionViewer.java:370)
at org.eclipse.jface.text.source.SourceViewer.setDocument(SourceViewer.java:473)
at org.eclipse.ui.texteditor.AbstractTextEditor.initializeSourceViewer(AbstractTextEditor.java:3786)
at org.eclipse.ui.texteditor.AbstractTextEditor.createPartControl(AbstractTextEditor.java:3332)
at org.eclipse.ui.texteditor.StatusTextEditor.createPartControl(StatusTextEditor.java:53)
at org.eclipse.ui.texteditor.AbstractDecoratedTextEditor.createPartControl(AbstractDecoratedTextEditor.java:378)
at lampion.eclipse.Editor.createPartControl(Editor.scala:148)
at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:661)
at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:426)
at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:592)
at org.eclipse.ui.internal.EditorReference.getEditor(EditorReference.java:263)
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2721)
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2633)
at org.eclipse.ui.internal.WorkbenchPage.access$12(WorkbenchPage.java:2625)
at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.java:2577)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2572)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2556)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2547)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:644)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:603)
at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:285)
at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:138)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:194)
at scala.tools.eclipse.navigator.OpenActionProvider$MyOpenAction.run(OpenActionProvider.scala:70)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:175)
at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:268)
at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:244)
at org.eclipse.jdt.internal.ui.navigator.OpenAndExpand.run(OpenAndExpand.java:50)
at org.eclipse.ui.actions.RetargetAction.run(RetargetAction.java:220)
at org.eclipse.ui.internal.navigator.CommonNavigatorManager$3.open(CommonNavigatorManager.java:181)
at org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredViewer.java:820)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:857)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:46)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:193)
at org.eclipse.jface.viewers.StructuredViewer.fireOpen(StructuredViewer.java:818)
at org.eclipse.jface.viewers.StructuredViewer.handleOpen(StructuredViewer.java:1079)
at org.eclipse.ui.navigator.CommonViewer.handleOpen(CommonViewer.java:353)
at org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(StructuredViewer.java:1183)
at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrategy.java:263)
at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.java:257)
at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:297)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1101)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3319)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2971)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2389)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2219)
at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:289)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:461)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:106)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:153)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:106)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:76)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:363)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:504)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:443)
at org.eclipse.equinox.launcher.Main.run(Main.java:1169)
It would go away only after closing and reopening the project. I could not reproduce this one a second time, but it involved the same file as the ticket #557.
Leave a comment
on 2008-02-28 01:38 *
By tracImporter
Trac author: mcdirmid
Trac author: mcdirmid
I hardened this part of the type checker (converting to a list before iterating), so hopefully its fixed.
I hardened this part of the type checker (converting to a list before iterating), so hopefully its fixed.
on 2009-01-14 12:54 *
By tracImporter
Closed As: fixed