Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 330085

Summary: Provide a disable capability
Product: [Modeling] EMFCompare Reporter: Ed Willink <ed>
Component: CoreAssignee: EMF Compare <emf.compare-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: critical    
Priority: P3 CC: cedric.brun, laurent.goubet, peter
Version: 2.6.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows Vista   
Whiteboard:

Description Ed Willink CLA 2010-11-12 08:30:41 EST
Eclipse 3.6.1

Please, please, please provide an ability to disable EMF Compare. When using Compare within the CVS Synchronize view, or Apply Patch view, EMF Compare almost always fails to show small model changes usefully. Whenever I get the option, I always switch to the text view. Unfortunately sometimes EMF Compare fails too seriously, so I just get a grey screen.

Below may be an example of a problem. However this bug is about disabling so that users are never left completely compare-less.

org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.NullPointerException)
at org.eclipse.swt.SWT.error(SWT.java:4083)
at org.eclipse.swt.SWT.error(SWT.java:3998)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:137)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4041)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3660)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)
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)
Caused by: java.lang.NullPointerException
at org.eclipse.emf.compare.ui.internal.RevisionComparisonHandler$RevisionedURIConverter.resolve(RevisionComparisonHandler.java:170)
at org.eclipse.emf.compare.ui.team.AbstractResolvingURIConverter.normalize(AbstractResolvingURIConverter.java:35)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResource(ResourceSetImpl.java:364)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.getPackageForURI(XMLHandler.java:2515)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.getFactoryForPrefix(XMLHandler.java:2422)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType(XMLHandler.java:1299)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createTopObject(XMLHandler.java:1468)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XMLHandler.java:1019)
at org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMIHandler.java:87)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHandler.java:1001)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHandler.java:712)
at org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHandler.java:169)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:501)
at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:179)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1343)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2755)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:395)
at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl.java:181)
at org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLResourceImpl.java:180)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1494)
at org.eclipse.emf.compare.util.ModelUtils.load(ModelUtils.java:305)
at org.eclipse.emf.compare.ui.internal.RevisionComparisonHandler.loadResources(RevisionComparisonHandler.java:103)
at org.eclipse.emf.compare.ui.internal.ModelComparator.loadResources(ModelComparator.java:486)
at org.eclipse.emf.compare.ui.viewer.structure.ModelStructureContentProvider.inputChanged(ModelStructureContentProvider.java:175)
at org.eclipse.jface.viewers.ContentViewer.setInput(ContentViewer.java:270)
at org.eclipse.jface.viewers.StructuredViewer.setInput(StructuredViewer.java:1664)
at org.eclipse.compare.CompareViewerSwitchingPane.setInput(CompareViewerSwitchingPane.java:276)
at org.eclipse.compare.internal.CompareStructureViewerSwitchingPane.setInput(CompareStructureViewerSwitchingPane.java:132)
at org.eclipse.compare.CompareEditorInput.feedInput(CompareEditorInput.java:746)
at org.eclipse.compare.CompareEditorInput.createContents(CompareEditorInput.java:554)
at org.eclipse.compare.internal.CompareEditor.createCompareControl(CompareEditor.java:456)
at org.eclipse.compare.internal.CompareEditor.access$6(CompareEditor.java:422)
at org.eclipse.compare.internal.CompareEditor$3.run(CompareEditor.java:378)
at org.eclipse.ui.internal.UILockListener.doPendingWork(UILockListener.java:164)
at org.eclipse.ui.internal.UISynchronizer$3.run(UISynchronizer.java:158)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134)
... 23 more
Comment 1 Cedric Brun CLA 2010-12-27 03:46:04 EST
Hi Ed,

well, we do have a Compare capability but it's not pre-installed in the Modeling Bundle, we'll make sure it gets in the bundle for Indigo.
Comment 2 Ed Willink CLA 2011-03-04 02:31:27 EST
M5 has a UI capability for Team->EMF Compare Engines, but it doesn't disable their activation from the CVS Perspective Open In Compare Editor. So I still get an NPE and no comparison when trying to compare UML files.
Comment 3 Laurent Goubet CLA 2011-05-03 05:33:44 EDT
What we disable with the capability doesn't seem restrictive enough (disabling pattern "org\.eclipse\.emf\.compare\.ui/.*" instead of "org\.eclipse\.emf\.compare\.*"). I'll investigate on the actual pattern we should use here and provide a nightly asap.
Comment 4 Laurent Goubet CLA 2011-05-03 08:16:32 EDT
And back to the starting point : capabilities cannot be used to disable our comparison engines. I had already investigated for a way to disable them without capabilities ... to no avail.

I'll leave this bug be for the time being, until someone saves the day and finds a way to provide an actual way to disable our contributions dynamically; for now, once they are contributed, we have no way to dynamically tell Platform/Compare that we need to be disabled.
Comment 5 Laurent Goubet CLA 2011-06-15 10:20:26 EDT
*** Bug 321447 has been marked as a duplicate of this bug. ***
Comment 6 Ed Willink CLA 2011-06-15 11:56:23 EDT
EMF Compare seems much better in RC4. I've seen UML compares 'successfully' fail and allow me to do text compares instead.
Comment 7 Laurent Goubet CLA 2013-01-11 10:48:20 EST
There shouldn't be any "hard failure" from compare anymore. The compare editor should always show itself and thus allow the switching to a regular textual comparison.

EMF Compare 1.3 ha also seen many fixes towards that end.
Comment 8 Laurent Goubet CLA 2013-01-11 10:50:19 EST
Should have been a won't fix : the actual demand of this bug has not been implemented, and it cannot be. There is no way to "disable" EMF Compare and no way AFAIK to implement such a thing : capabilities are not enough and the platform does not allow us to "disable" extension point contributions.