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

Bug 489302

Summary: IllegalArgumentException when selecting the "Rulers and Grids" legacy GMF tab
Product: [Modeling] Sirius Reporter: Pierre-Charles David <pierre-charles.david>
Component: PropertiesAssignee: Project Inbox <sirius.properties-inbox>
Status: CLOSED FIXED QA Contact: Julien Dupont <julien.dupont>
Severity: critical    
Priority: P3 CC: julien.dupont, stephane.begaudeau
Version: 3.1.0Keywords: triaged
Target Milestone: 4.1.0   
Hardware: All   
OS: All   
See Also: https://git.eclipse.org/r/69438
https://git.eclipse.org/c/eef/org.eclipse.eef.git/commit/?id=2e175ceebd200bd8ef2689f9714f6c34369dc475
Whiteboard:
Bug Depends on:    
Bug Blocks: 495366    

Description Pierre-Charles David CLA 2016-03-09 11:11:14 EST
With the Sirius-defined properties views installed/enabled:

1. Open a Sirius diagram.
2. Select the diagram itself (not an element inside of it).
3. In the properties view, select the "Rulers and Grid" legacy GMF tab:

java.lang.IllegalArgumentException
	at org.eclipse.core.runtime.ListenerList.add(ListenerList.java:113)
	at org.eclipse.core.commands.common.EventManager.addListenerObject(EventManager.java:58)
	at org.eclipse.jface.preference.PreferenceStore.addPropertyChangeListener(PreferenceStore.java:106)
	at org.eclipse.gmf.runtime.diagram.ui.properties.sections.grid.RulerGridPropertySection.initWorkspacePropertyListener(RulerGridPropertySection.java:883)
	at org.eclipse.gmf.runtime.diagram.ui.properties.sections.grid.RulerGridPropertySection.setInput(RulerGridPropertySection.java:624)
	at org.eclipse.eef.properties.ui.legacy.internal.legacy2eef.EEFLegacySection.setInput(EEFLegacySection.java:151)
	at org.eclipse.eef.properties.ui.api.EEFTabContents$2.run(EEFTabContents.java:117)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:50)
	at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:173)
	at org.eclipse.eef.properties.ui.api.EEFTabContents.setInput(EEFTabContents.java:120)
	at org.eclipse.eef.properties.ui.api.EEFTabbedPropertySheetPage.processSelectionChanged(EEFTabbedPropertySheetPage.java:534)
	at org.eclipse.eef.properties.ui.api.EEFTabbedPropertySheetPage.access$0(EEFTabbedPropertySheetPage.java:508)
	at org.eclipse.eef.properties.ui.api.EEFTabbedPropertySheetPage$1.selectionChanged(EEFTabbedPropertySheetPage.java:247)
	at org.eclipse.eef.properties.ui.internal.page.EEFTabbedPropertyViewer.fireSelectionChanged(EEFTabbedPropertyViewer.java:117)
	at org.eclipse.eef.properties.ui.internal.page.EEFTabbedPropertyViewer.access$1(EEFTabbedPropertyViewer.java:115)
	at org.eclipse.eef.properties.ui.internal.page.EEFTabbedPropertyViewer$1.widgetSelected(EEFTabbedPropertyViewer.java:99)
	at org.eclipse.jface.util.OpenStrategy.fireSelectionEvent(OpenStrategy.java:242)
Comment 1 Stephane Begaudeau CLA 2016-03-29 08:58:22 EDT
In the GMF RulerGridPropertySection, the following lifecycle is not supported:

- new section
- section#setInput
- section#dispose
- section#setInput again

I have not yet identified why after the call to dispose we are still manipulating the object and not creating a new instance of this object if we need one.
Comment 2 Stephane Begaudeau CLA 2016-03-29 09:18:22 EDT
I don't know why yet but calling EEFTabbedPropertyRegistry#getTabDescriptors(part, selection) can return EEFSectionDescriptors containing references to previously disposed EEFSection.
Comment 3 Eclipse Genie CLA 2016-03-29 10:03:30 EDT
New Gerrit change created: https://git.eclipse.org/r/69438
Comment 5 Pierre-Charles David CLA 2016-06-09 09:42:06 EDT
I believe this was actually fixed for 4.0 by the commit referenced above, but the ticket was not close so it was not verified.
Comment 6 Pierre-Charles David CLA 2016-06-20 11:02:53 EDT
Confirmed fixed on master, and was probably already OK for 4.0.
Comment 7 Pierre-Charles David CLA 2016-10-18 11:09:19 EDT
Available in Sirius 4.1.0, see https://wiki.eclipse.org/Sirius/4.1.0 for details.