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

Bug 507314

Summary: Default rules require the reference widget to work, but do not explicitly depend on it
Product: [Modeling] Sirius Reporter: Axel Guckelsberger <info>
Component: PropertiesAssignee: Project Inbox <sirius.properties-inbox>
Status: CLOSED FIXED QA Contact: Laurent Redor <laurent.redor>
Severity: major    
Priority: P3 CC: laurent.redor, pierre-charles.david
Version: 4.1.0Keywords: triaged
Target Milestone: 5.0.0M7   
Hardware: All   
OS: All   
See Also: https://git.eclipse.org/r/96132
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=17ae4d0490218780375397a7823c1bca1dd89cae
Whiteboard:
Attachments:
Description Flags
Screenshot of debugger none

Description Axel Guckelsberger CLA 2016-11-09 12:12:59 EST
Created attachment 265280 [details]
Screenshot of debugger

When I select any model element in the diagram editor the new property sheet throws NPEs after updating from 4.1.0 to 4.1.1.

Here is an example stack trace:

[code]
java.lang.NullPointerException
	at org.eclipse.sirius.ui.properties.api.AbstractDescriptionConverter.convertEObject(AbstractDescriptionConverter.java:53)
	at org.eclipse.sirius.ui.properties.api.DefaultDescriptionConverter.convertEReference(DefaultDescriptionConverter.java:155)
	at org.eclipse.sirius.ui.properties.api.DefaultDescriptionConverter.convert(DefaultDescriptionConverter.java:81)
	at org.eclipse.sirius.ui.properties.api.AbstractDescriptionConverter.convertEObject(AbstractDescriptionConverter.java:53)
	at org.eclipse.sirius.ui.properties.api.AbstractDescriptionConverter.convertCollection(AbstractDescriptionConverter.java:81)
	at org.eclipse.sirius.ui.properties.api.DefaultDescriptionConverter.convertEReference(DefaultDescriptionConverter.java:147)
	at org.eclipse.sirius.ui.properties.api.DefaultDescriptionConverter.convert(DefaultDescriptionConverter.java:81)
	at org.eclipse.sirius.ui.properties.api.AbstractDescriptionConverter.convertEObject(AbstractDescriptionConverter.java:53)
	at org.eclipse.sirius.ui.properties.api.AbstractDescriptionConverter.convertCollection(AbstractDescriptionConverter.java:81)
	at org.eclipse.sirius.ui.properties.internal.tabprovider.GroupDescriptionConverter.convert(GroupDescriptionConverter.java:64)
	at org.eclipse.sirius.ui.properties.internal.tabprovider.ViewDescriptionConverter.convert(ViewDescriptionConverter.java:82)
	at org.eclipse.sirius.ui.properties.internal.tabprovider.SiriusTabDescriptorProvider.getTabDescriptors(SiriusTabDescriptorProvider.java:124)
	at org.eclipse.sirius.ui.properties.internal.tabprovider.SiriusTabDescriptorProvider.getTabDescriptors(SiriusTabDescriptorProvider.java:120)
	at org.eclipse.sirius.ui.properties.internal.tabprovider.SiriusTabDescriptorProvider.get(SiriusTabDescriptorProvider.java:103)
	at org.eclipse.eef.properties.ui.internal.registry.EEFTabbedPropertyRegistry.getAllTabDescriptors(EEFTabbedPropertyRegistry.java:81)
	at org.eclipse.eef.properties.ui.internal.registry.EEFTabbedPropertyRegistry.getTabDescriptors(EEFTabbedPropertyRegistry.java:123)
	at org.eclipse.eef.properties.ui.api.EEFTabbedPropertySheetPage.doSetInput(EEFTabbedPropertySheetPage.java:310)
	at org.eclipse.eef.properties.ui.api.EEFTabbedPropertySheetPage.setInput(EEFTabbedPropertySheetPage.java:256)
	at org.eclipse.eef.properties.ui.api.EEFTabbedPropertySheetPage.selectionChanged(EEFTabbedPropertySheetPage.java:239)
[/code]

I tried to debug it and found that [i]converter[/i] is null. See the attached screenshot.


Any idea about this?
Comment 1 Pierre-Charles David CLA 2016-11-10 03:37:54 EST
Hi.

This is because the default rules used to render properties views make use of a custom widget to display references. Unfortunately, because of cyclic dependencies, the org.eclipse.sirius.ui.properties plug-in can not explicilty depend on the required plug-in which provides that widget.

To my knowledge, it should not happen if you installed everthing at the feature level (i.e. install the whole org.eclipse.sirius.properties.feature feature), or if you otherwise make sure the org.eclipse.sirius.ui.properties.ext.widgets.reference plug-in is installed.

I've pushed https://git.eclipse.org/r/#/c/84653/ two days ago to give a better feedback than an NPE when the converter is not found, but this does not fix the underlying issue. I'll reword this ticket to match the underlying problem; the NPE itself should be fixed, but it was just a symptom.
Comment 2 Axel Guckelsberger CLA 2016-11-10 05:00:28 EST
Hi,

indeed a missing dependency caused this problem. Thanks for the assistance.
Comment 3 Pierre-Charles David CLA 2016-11-29 05:02:46 EST
Moving to 5.0, as this would require packaging changes that we can not implement in a pure maintenance release.
Comment 4 Eclipse Genie CLA 2017-05-02 03:50:23 EDT
New Gerrit change created: https://git.eclipse.org/r/96132
Comment 6 Pierre-Charles David CLA 2017-05-04 10:43:59 EDT
Fixed by 17ae4d0490218780375397a7823c1bca1dd89cae: the default rules are now provided by a separate plug-in (org.eclipse.sirius.properties.defaultrules), which explicitly depends on all the widgets it uses.
Comment 7 Laurent Redor CLA 2017-05-22 08:24:30 EDT
Validated with OD CE 5.0 M7.

I've not really tested to reproduce the NPE. But in OD CE, I checked these dependencies:
* org.eclipse.sirius.properties.core depends on org.eclipse.sirius.properties and org.eclipse.sirius.properties.defaultrules
* org.eclipse.sirius.properties.defaultrules depends on org.eclipse.sirius.properties and org.eclipse.sirius.properties.ext.widgets.reference
* org.eclipse.sirius.properties.ext.widgets.reference depends on org.eclipse.sirius.properties
* org.eclipse.sirius.ui.properties depends on org.eclipse.sirius.properties, org.eclipse.sirius.properties.core, org.eclipse.sirius.properties.defaultrules and org.eclipse.sirius.properties.ext.widgets.reference
Comment 8 Pierre-Charles David CLA 2017-06-29 03:32:15 EDT
Available in Sirius 5.0.0, see https://wiki.eclipse.org/Sirius/5.0.0 for details.