Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 324508 - Spurious "Could not test xml nature"
Summary: Spurious "Could not test xml nature"
Status: CLOSED FIXED
Alias: None
Product: MoDisco
Classification: Modeling
Component: Infrastructure (show other bugs)
Version: 0.9.0   Edit
Hardware: PC Windows Vista
: P3 normal (vote)
Target Milestone: 0.9.0 M2   Edit
Assignee: Nicolas Bros CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-04 05:11 EDT by Ed Willink CLA
Modified: 2010-10-18 08:38 EDT (History)
5 users (show)

See Also:
nicolas.bros: indigo+
fabien.giquel: review+


Attachments
patch (24.20 KB, patch)
2010-09-06 04:57 EDT, Nicolas Bros CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Willink CLA 2010-09-04 05:11:43 EDT
My error log is filling up with 

Could not test xml nature for file L/org.eclipse.ocl.examples.xtext.tests/bin/org/eclipse/ocl/examples/test/xtext/models/mini.oclstdlib

org.eclipse.core.internal.resources.ResourceException: Resource is out of sync with the file system: '/org.eclipse.ocl.examples.xtext.tests/bin/org/eclipse/ocl/examples/test/xtext/models/mini.oclstdlib'.
at org.eclipse.core.internal.resources.File.checkSynchronized(File.java:103)
at org.eclipse.core.internal.resources.File.getContentDescription(File.java:273)
at org.eclipse.gmt.modisco.xml.discoverer.actions.XMLModelDiscoverer.isApplicableTo(XMLModelDiscoverer.java:105)
at org.eclipse.gmt.modisco.infra.discoverymanager.handlers.DiscovererHandler.isApplicableTo(DiscovererHandler.java:53)
at org.eclipse.gmt.modisco.infra.discoverymanager.ui.actions.ContributionItemForMoDiscoMenu.fill(ContributionItemForMoDiscoMenu.java:84)
at org.eclipse.ui.internal.menus.DynamicMenuContributionItem.fill(DynamicMenuContributionItem.java:125)
at org.eclipse.jface.action.MenuManager.doItemFill(MenuManager.java:737)
at org.eclipse.jface.action.MenuManager.update(MenuManager.java:818)
at org.eclipse.jface.action.MenuManager.update(MenuManager.java:678)
at org.eclipse.ui.internal.menus.WorkbenchMenuService.updateManagers(WorkbenchMenuService.java:330)
at org.eclipse.ui.internal.menus.WorkbenchMenuService$4.propertyChange(WorkbenchMenuService.java:316)
at org.eclipse.ui.internal.services.EvaluationAuthority$1.run(EvaluationAuthority.java:252)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.ui.internal.services.EvaluationAuthority.fireServiceChange(EvaluationAuthority.java:246)
at org.eclipse.ui.internal.services.EvaluationAuthority.endSourceChange(EvaluationAuthority.java:197)
at org.eclipse.ui.internal.services.EvaluationAuthority.sourceChanged(EvaluationAuthority.java:135)
at org.eclipse.ui.internal.services.ExpressionAuthority.sourceChanged(ExpressionAuthority.java:311)
at org.eclipse.ui.internal.services.ExpressionAuthority.sourceChanged(ExpressionAuthority.java:290)
at org.eclipse.ui.AbstractSourceProvider.fireSourceChanged(AbstractSourceProvider.java:99)
at org.eclipse.ui.internal.services.MenuSourceProvider.addShowingMenus(MenuSourceProvider.java:80)
at org.eclipse.ui.internal.Workbench.addShowingMenus(Workbench.java:3718)
at org.eclipse.ui.internal.PopupMenuExtender.menuAboutToShow(PopupMenuExtender.java:325)
at org.eclipse.jface.action.MenuManager.fireAboutToShow(MenuManager.java:338)
at org.eclipse.jface.action.MenuManager.handleAboutToShow(MenuManager.java:469)
at org.eclipse.jface.action.MenuManager.access$1(MenuManager.java:465)
at org.eclipse.jface.action.MenuManager$2.menuShown(MenuManager.java:491)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:241)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1077)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1058)
at org.eclipse.swt.widgets.Control.WM_INITMENUPOPUP(Control.java:4485)
at org.eclipse.swt.widgets.Control.windowProc(Control.java:4188)
at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:341)
at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java:1598)
at org.eclipse.swt.widgets.Shell.windowProc(Shell.java:2038)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:4873)
at org.eclipse.swt.internal.win32.OS.TrackPopupMenu(Native Method)
at org.eclipse.swt.widgets.Menu._setVisible(Menu.java:256)
at org.eclipse.swt.widgets.Display.runPopups(Display.java:4107)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3651)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2629)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2593)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2427)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:670)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:663)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
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:619)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
at org.eclipse.equinox.launcher.Main.main(Main.java:1383)

-------------------

These occur for many files.

Why are 'bin' files being examined at all.

Since I'm not actively using Modisco, why am I incurring a significant file scanning cost?
Comment 1 Nicolas Bros CLA 2010-09-06 04:57:20 EDT
Created attachment 178250 [details]
patch

Here is a patch: 
- don't emit a warning if the file is not synchronized with the workspace
- compute applicable discoverers lazily, when the "MoDisco" sub-menu is being opened. This avoids incurring a performance cost for each right-click (which grows as new discoverers are added). But as a side-effect, the "MoDisco" item always appears, even when there are no applicable discoverers. In this case, if this "MoDisco" sub-menu is opened, it contains a disabled item that reads "No discoverer is applicable to this selection".
Comment 2 Fabien Giquel CLA 2010-09-09 04:52:46 EDT
I had a look on generic part of the fix :
I totally agree with "lazy applicable discoverers computing" strategy, even if it causes some empty submenu in some cases. As Edward pointed it out, is was a real problem to impose recurrent scanning time for the eclipse user.
Comment 3 Nicolas Bros CLA 2010-09-09 06:13:07 EDT
Committed in revision 3004.
Comment 4 Hugo Bruneliere CLA 2010-10-05 04:55:22 EDT
The patch has been successfully applied.