osate / osate2

Open Source AADL2 Tool Environment
http://osate.org
Eclipse Public License 2.0
39 stars 8 forks source link

ResourceException in AadlNavigator #587

Closed joeseibel closed 6 years ago

joeseibel commented 9 years ago

The exception happens when I move an aadl file from one directory to another within the same project by dragging and dropping.

Stack trace:

org.eclipse.core.internal.resources.ResourceException: The resource tree is locked for modifications.
    at org.eclipse.core.internal.resources.WorkManager.checkIn(WorkManager.java:116)
    at org.eclipse.core.internal.resources.Workspace.prepareOperation(Workspace.java:2251)
    at org.eclipse.core.internal.resources.Resource.deleteMarkers(Resource.java:844)
    at org.osate.aadl2.modelsupport.errorreporting.MarkerParseErrorReporter.deleteMessagesImpl(MarkerParseErrorReporter.java:117)
    at org.osate.aadl2.modelsupport.errorreporting.AbstractErrorReporter.deleteMessages(AbstractErrorReporter.java:56)
    at org.osate.aadl2.modelsupport.errorreporting.ParseErrorReporterManager.getReporter(ParseErrorReporterManager.java:116)
    at org.osate.xtext.aadl2.parsing.AnnexParserAgent.afterModelLinked(AnnexParserAgent.java:122)
    at org.eclipse.xtext.linking.impl.AbstractCleaningLinker.linkModel(AbstractCleaningLinker.java:53)
    at org.eclipse.xtext.resource.XtextResource.doLinking(XtextResource.java:290)
    at org.eclipse.xtext.linking.lazy.LazyLinkingResource.doLinking(LazyLinkingResource.java:107)
    at org.eclipse.xtext.resource.XtextResource.updateInternalState(XtextResource.java:258)
    at org.eclipse.xtext.resource.XtextResource.updateInternalState(XtextResource.java:248)
    at org.eclipse.xtext.resource.XtextResource.doLoad(XtextResource.java:161)
    at org.eclipse.xtext.linking.lazy.LazyLinkingResource.doLoad(LazyLinkingResource.java:100)
    at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1518)
    at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1297)
    at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoad(ResourceSetImpl.java:259)
    at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:274)
    at org.eclipse.xtext.resource.XtextResourceSet.getResource(XtextResourceSet.java:229)
    at org.eclipse.xtext.resource.SynchronizedXtextResourceSet.getResource(SynchronizedXtextResourceSet.java:24)
    at org.osate.aadl2.modelsupport.resources.OsateResourceUtil.getResource(OsateResourceUtil.java:456)
    at org.osate.aadl2.modelsupport.resources.OsateResourceUtil.getResource(OsateResourceUtil.java:429)
    at org.osate.ui.navigator.AadlNavigatorContentProvider.getChildren(AadlNavigatorContentProvider.java:79)
    at org.eclipse.ui.model.BaseWorkbenchContentProvider.hasChildren(BaseWorkbenchContentProvider.java:96)
    at org.eclipse.ui.internal.navigator.extensions.SafeDelegateTreeContentProvider.hasChildren(SafeDelegateTreeContentProvider.java:110)
    at org.eclipse.ui.internal.navigator.NavigatorContentServiceContentProvider.callNormalHasChildren(NavigatorContentServiceContentProvider.java:430)
    at org.eclipse.ui.internal.navigator.NavigatorContentServiceContentProvider.access$4(NavigatorContentServiceContentProvider.java:425)
    at org.eclipse.ui.internal.navigator.NavigatorContentServiceContentProvider$3.run(NavigatorContentServiceContentProvider.java:395)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.ui.internal.navigator.NavigatorContentServiceContentProvider.hasChildren(NavigatorContentServiceContentProvider.java:381)
    at org.eclipse.ui.internal.navigator.NavigatorContentServiceContentProvider.hasChildren(NavigatorContentServiceContentProvider.java:422)
    at org.eclipse.jface.viewers.AbstractTreeViewer.isExpandable(AbstractTreeViewer.java:2133)
    at org.eclipse.jface.viewers.TreeViewer.isExpandable(TreeViewer.java:553)
    at org.eclipse.jface.viewers.AbstractTreeViewer.isExpandable(AbstractTreeViewer.java:2171)
    at org.eclipse.jface.viewers.AbstractTreeViewer.updatePlus(AbstractTreeViewer.java:2863)
    at org.eclipse.jface.viewers.TreeViewer.updatePlus(TreeViewer.java:804)
    at org.eclipse.jface.viewers.AbstractTreeViewer.createTreeItem(AbstractTreeViewer.java:844)
    at org.eclipse.jface.viewers.AbstractTreeViewer.createAddedElements(AbstractTreeViewer.java:412)
    at org.eclipse.jface.viewers.AbstractTreeViewer.internalAdd(AbstractTreeViewer.java:281)
    at org.eclipse.jface.viewers.TreeViewer.internalAdd(TreeViewer.java:630)
    at org.eclipse.jface.viewers.AbstractTreeViewer.add(AbstractTreeViewer.java:156)
    at org.eclipse.ui.navigator.CommonViewer.add(CommonViewer.java:303)
    at org.eclipse.ui.model.WorkbenchContentProvider$2.run(WorkbenchContentProvider.java:295)
    at org.eclipse.ui.model.WorkbenchContentProvider.runUpdates(WorkbenchContentProvider.java:159)
    at org.eclipse.ui.model.WorkbenchContentProvider.processDelta(WorkbenchContentProvider.java:132)
    at org.eclipse.ui.model.WorkbenchContentProvider.resourceChanged(WorkbenchContentProvider.java:106)
    at org.eclipse.core.internal.events.NotificationManager$1.run(NotificationManager.java:291)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.core.internal.events.NotificationManager.notify(NotificationManager.java:285)
    at org.eclipse.core.internal.events.NotificationManager.broadcastChanges(NotificationManager.java:149)
    at org.eclipse.core.internal.resources.Workspace.broadcastPostChange(Workspace.java:378)
    at org.eclipse.core.internal.resources.Workspace.checkpoint(Workspace.java:540)
    at org.eclipse.ltk.core.refactoring.PerformChangeOperation$1.run(PerformChangeOperation.java:263)
    at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2313)
    at org.eclipse.ltk.core.refactoring.PerformChangeOperation.executeChange(PerformChangeOperation.java:306)
    at org.eclipse.ltk.core.refactoring.PerformChangeOperation.run(PerformChangeOperation.java:223)
    at org.eclipse.ltk.core.refactoring.PerformRefactoringOperation.run(PerformRefactoringOperation.java:136)
    at org.eclipse.ui.navigator.resources.ResourceDropAdapterAssistant$2.run(ResourceDropAdapterAssistant.java:534)
    at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2313)
    at org.eclipse.ui.navigator.resources.ResourceDropAdapterAssistant$3.run(ResourceDropAdapterAssistant.java:543)
    at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:466)
    at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:374)
    at org.eclipse.jface.dialogs.ProgressMonitorDialog.run(ProgressMonitorDialog.java:527)
    at org.eclipse.ui.internal.progress.ProgressMonitorJobsDialog.run(ProgressMonitorJobsDialog.java:284)
    at org.eclipse.ui.internal.progress.ProgressManager.run(ProgressManager.java:1190)
    at org.eclipse.ui.navigator.resources.ResourceDropAdapterAssistant.performResourceMove(ResourceDropAdapterAssistant.java:554)
    at org.eclipse.ui.navigator.resources.ResourceDropAdapterAssistant.handleDrop(ResourceDropAdapterAssistant.java:246)
    at org.eclipse.ui.navigator.CommonDropAdapter$1.run(CommonDropAdapter.java:194)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.ui.navigator.CommonDropAdapter.performDrop(CommonDropAdapter.java:184)
    at org.eclipse.jface.viewers.ViewerDropAdapter.drop(ViewerDropAdapter.java:254)
    at org.eclipse.ui.part.PluginDropAdapter.drop(PluginDropAdapter.java:70)
    at org.eclipse.swt.dnd.DNDListener.handleEvent(DNDListener.java:91)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4199)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1467)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1490)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1475)
    at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1279)
    at org.eclipse.swt.dnd.DropTarget.drop(DropTarget.java:728)
    at org.eclipse.swt.dnd.DropTarget.outlineView_acceptDrop_item_childIndex(DropTarget.java:746)
    at org.eclipse.swt.dnd.DropTarget.dropTargetProc(DropTarget.java:471)
    at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method)
    at org.eclipse.swt.dnd.DropTarget.dndCallSuper(DropTarget.java:210)
    at org.eclipse.swt.dnd.DropTarget.performDragOperation(DropTarget.java:739)
    at org.eclipse.swt.dnd.DropTarget.dropTargetProc(DropTarget.java:456)
    at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method)
    at org.eclipse.swt.widgets.Widget.callSuper(Widget.java:221)
    at org.eclipse.swt.widgets.Widget.mouseDownSuper(Widget.java:1101)
    at org.eclipse.swt.widgets.Tree.mouseDownSuper(Tree.java:2064)
    at org.eclipse.swt.widgets.Widget.mouseDown(Widget.java:1093)
    at org.eclipse.swt.widgets.Control.mouseDown(Control.java:2563)
    at org.eclipse.swt.widgets.Tree.mouseDown(Tree.java:2032)
    at org.eclipse.swt.widgets.Display.windowProc(Display.java:5638)
    at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method)
    at org.eclipse.swt.widgets.Widget.callSuper(Widget.java:221)
    at org.eclipse.swt.widgets.Widget.windowSendEvent(Widget.java:2105)
    at org.eclipse.swt.widgets.Shell.windowSendEvent(Shell.java:2329)
    at org.eclipse.swt.widgets.Display.windowProc(Display.java:5702)
    at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method)
    at org.eclipse.swt.widgets.Display.applicationSendEvent(Display.java:5139)
    at org.eclipse.swt.widgets.Display.applicationProc(Display.java:5288)
    at org.eclipse.swt.internal.cocoa.OS.objc_msgSend(Native Method)
    at org.eclipse.swt.internal.cocoa.NSApplication.sendEvent(NSApplication.java:128)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3666)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032)
    at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148)
    at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1438)
lwrage commented 7 years ago

The fix caused other problems (#891, #613) and was reverted by #906, reopening.

lwrage commented 6 years ago

Moving a file causes the file content to be read again to determine if the file can be expanded in the navigator. Reading the content involves parsing and annex processing. Somewhere along the line markers are deleted. This is a resource change that is not allowed in a resource listener.