Community
Participate
Working Groups
Created attachment 279920 [details] Sample Project In some cases, opening a model compare will result in NullPointerExceptions in org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider.getPropertySource(). Steps to reproduce: 1. Open the example "Farm" project in the FarmModel.zip attachment 2. Repeat 3 times: 2.1. Control/Command-click "model/Farm1.xmi" and "model/Farm2.xmi" so that both files are selected 2.2. Right click one of the selected files and select Compare With > Each Other. 2.3. After the Compare editor opens, close and repeat. The observed results each time repeating step 2: 1. The first time, ClassNotFound errors are displayed in the Problems tab. (This is not an issue in our actual models) 2. The second time, the compare view opens with no issue (as expected). 3. The third and subsequent times, a "Multiple problems have occurred" error dialog appears with 3 NullPointerExceptions. This is with the Eclipse Modeling Tools 2019-09 release on macOS and Windows. Here is the full stack trace of one of the exceptions in the log: !ENTRY org.eclipse.jface 4 2 2019-09-18 11:37:50.590 !MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.jface". !STACK 0 java.lang.NullPointerException at org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider.getPropertySource(AdapterFactoryContentProvider.java:244) at org.eclipse.ui.views.properties.PropertySheetEntry.getPropertySource(PropertySheetEntry.java:452) at org.eclipse.ui.views.properties.PropertySheetEntry.setValues(PropertySheetEntry.java:721) at org.eclipse.emf.edit.ui.view.ExtendedPropertySheetPage$ExtendedPropertySheetEntry.setValues(ExtendedPropertySheetPage.java:942) at org.eclipse.ui.views.properties.PropertySheetViewer.setInput(PropertySheetViewer.java:979) at org.eclipse.ui.views.properties.PropertySheetPage.selectionChanged(PropertySheetPage.java:507) at org.eclipse.emf.edit.ui.view.ExtendedPropertySheetPage.selectionChanged(ExtendedPropertySheetPage.java:553) at org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer.EMFCompareContentMergeViewer.updatePropertiesView(EMFCompareContentMergeViewer.java:764) at org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer.EMFCompareContentMergeViewer.synchronizeSelection(EMFCompareContentMergeViewer.java:712) at org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer.EMFCompareContentMergeViewer.selectionChanged(EMFCompareContentMergeViewer.java:704) at org.eclipse.jface.viewers.Viewer$1.run(Viewer.java:151) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) at org.eclipse.ui.internal.JFaceUtil.lambda$0(JFaceUtil.java:47) at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:174) at org.eclipse.jface.viewers.Viewer.fireSelectionChanged(Viewer.java:148) at org.eclipse.emf.compare.rcp.ui.internal.mergeviewer.impl.AbstractStructuredMergeViewer.access$0(AbstractStructuredMergeViewer.java:1) at org.eclipse.emf.compare.rcp.ui.internal.mergeviewer.impl.AbstractStructuredMergeViewer$ForwardingViewerSelectionListener.selectionChanged(AbstractStructuredMergeViewer.java:246) at org.eclipse.jface.viewers.Viewer$1.run(Viewer.java:151) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) at org.eclipse.ui.internal.JFaceUtil.lambda$0(JFaceUtil.java:47) at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:174) at org.eclipse.jface.viewers.Viewer.fireSelectionChanged(Viewer.java:148) at org.eclipse.jface.viewers.StructuredViewer.updateSelection(StructuredViewer.java:2118) at org.eclipse.jface.viewers.StructuredViewer.setSelection(StructuredViewer.java:1655) at org.eclipse.jface.viewers.TreeViewer.setSelection(TreeViewer.java:1084) at org.eclipse.jface.viewers.Viewer.setSelection(Viewer.java:376) at org.eclipse.emf.compare.rcp.ui.internal.mergeviewer.impl.TreeMergeViewer.inputChanged(TreeMergeViewer.java:135) at org.eclipse.jface.viewers.ContentViewer.setInput(ContentViewer.java:282) at org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer.EMFCompareContentMergeViewer.updateContent(EMFCompareContentMergeViewer.java:294) at org.eclipse.compare.contentmergeviewer.ContentMergeViewer.internalRefresh(ContentMergeViewer.java:794) at org.eclipse.compare.contentmergeviewer.ContentMergeViewer.inputChanged(ContentMergeViewer.java:702) at org.eclipse.jface.viewers.ContentViewer.setInput(ContentViewer.java:282) at org.eclipse.compare.CompareViewerSwitchingPane.setInput(CompareViewerSwitchingPane.java:268) at org.eclipse.compare.internal.CompareContentViewerSwitchingPane.setInput(CompareContentViewerSwitchingPane.java:190) at org.eclipse.compare.CompareEditorInput.internalSetContentPaneInput(CompareEditorInput.java:805) at org.eclipse.compare.CompareEditorInput.lambda$8(CompareEditorInput.java:753) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:72) at org.eclipse.compare.CompareEditorInput.feed1(CompareEditorInput.java:741) at org.eclipse.compare.CompareEditorInput.lambda$4(CompareEditorInput.java:639) at org.eclipse.compare.CompareViewerPane.open(CompareViewerPane.java:312) at org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredViewer.java:797) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) at org.eclipse.ui.internal.JFaceUtil.lambda$0(JFaceUtil.java:47) at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:174) at org.eclipse.jface.viewers.StructuredViewer.fireOpen(StructuredViewer.java:794) at org.eclipse.emf.compare.ide.ui.internal.structuremergeviewer.AbstractStructuredViewerWrapper.access$6(AbstractStructuredViewerWrapper.java:1) at org.eclipse.emf.compare.ide.ui.internal.structuremergeviewer.AbstractStructuredViewerWrapper$5.open(AbstractStructuredViewerWrapper.java:144) at org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredViewer.java:797) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) at org.eclipse.ui.internal.JFaceUtil.lambda$0(JFaceUtil.java:47) at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:174) at org.eclipse.jface.viewers.StructuredViewer.fireOpen(StructuredViewer.java:794) at org.eclipse.emf.compare.ide.ui.internal.structuremergeviewer.WrappableTreeViewer.fireOpen(WrappableTreeViewer.java:868) at org.eclipse.emf.compare.ide.ui.internal.structuremergeviewer.Navigatable.fireOpen(Navigatable.java:126) at org.eclipse.emf.compare.ide.ui.internal.structuremergeviewer.Navigatable$1.run(Navigatable.java:70) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:40) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:185) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4145) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3812) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1160) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1049) at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155) at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:633) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:557) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:150) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255) 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:498) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:660) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:597) at org.eclipse.equinox.launcher.Main.run(Main.java:1468)
Created attachment 279921 [details] Workbench Log
The first issue (ClassNotFound) is due to EMF Compare not completely supporting models with relative schemaLocations as you're using with the farm.ecore schema. I cannot reproduce any further issue with Eclipse 2019-06 but we've seen a similar exception happen in some environment. Could you tell me if you've installed any other plug-in in your Eclipse Modeling Tool bundle?
I could reproduce the next bugs. I (obviously) needed to have the properties view opened to reproduce a bug in the properties view :). This is due to Bug 551238. I'll push a workaround in the meantime if possible.
New Gerrit change created: https://git.eclipse.org/r/149834
New Gerrit change created: https://git.eclipse.org/r/149833
New Gerrit change created: https://git.eclipse.org/r/149832
New Gerrit change created: https://git.eclipse.org/r/149835
This simple example was hiding 4 potential issues. https://git.eclipse.org/r/149832 - EMF Compare did not support relative paths for xsi:schemaLocation declarations. https://git.eclipse.org/r/149835 - With local comparisons of very small models using workspace-local schemaLocations, we could stumble on a multi-threading issue causing the second of these small models to find the EPackage before it has finished loading. https://git.eclipse.org/r/149833 - Some implementations of the Resource.Diagnostic reporting issues when loading a resource set may use "null" as the resource's URI, preventing EMF Compare from reporting the accurate error because of a NullPointerException. https://git.eclipse.org/r/149834 - When the properties view is opened, EMF Compare will update it with selections from the compare editor. Closing this editor will thus cleanup our contributions to the PropertySheetPage. Somewhere between Photon and 2019-09, the PropertySheetPage has started to dispose of its viewer by itself, and the EMF implementation (ExtendedPropertySheetPage) was not protected against this disposal, failing in NPE (bug 551238). Though EMF will be fixed to prevent this NPE, we can also protect the code from EMF Compare to avoid future issues. All of this will be available in the next nightly of EMF Compare.
Gerrit change https://git.eclipse.org/r/149832 was merged to [master]. Commit: http://git.eclipse.org/c/emfcompare/org.eclipse.emf.compare.git/commit/?id=029f49dd7fd2d30120e778c4d73f973a227ef80a
Gerrit change https://git.eclipse.org/r/149835 was merged to [master]. Commit: http://git.eclipse.org/c/emfcompare/org.eclipse.emf.compare.git/commit/?id=1e8e5f26ded939c2434cb68d641092d270682c01
Gerrit change https://git.eclipse.org/r/149834 was merged to [master]. Commit: http://git.eclipse.org/c/emfcompare/org.eclipse.emf.compare.git/commit/?id=eebd410a09df9461857f27a090e5f0b77a823d4e
Gerrit change https://git.eclipse.org/r/149833 was merged to [master]. Commit: http://git.eclipse.org/c/emfcompare/org.eclipse.emf.compare.git/commit/?id=5074797c0219b87449b5692a1521d7cfaafb9420
Wow, Thanks for the quick resolution!