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

Bug 467706

Summary: [Table 2] Tree Table with no tree filling configuration on depth==0 can't be reopened
Product: [Modeling] Papyrus Reporter: Vincent Lorenzo <vincent.lorenzo>
Component: TableAssignee: Vincent Lorenzo <vincent.lorenzo>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: eclipse-bugzilla
Version: 1.0.2   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
See Also: https://git.eclipse.org/r/61448
https://git.eclipse.org/c/papyrus/org.eclipse.papyrus.git/commit/?id=5a8347c6a3bceb39103ea0362085c9426c3c4b7e
https://git.eclipse.org/r/63911
https://git.eclipse.org/c/papyrus/org.eclipse.papyrus.git/commit/?id=c7d60d9b7e13e5cc169a1374538cad0e26f786b1
Whiteboard:
Bug Depends on:    
Bug Blocks: 466447    

Description Vincent Lorenzo CLA 2015-05-20 08:35:40 EDT
Steps to reproduce 
1/ Create a new Class Tree Table
2/ Configure the categories to remove the tree filling configuration on depth0
3/ drop a class into the table (you can expand it)
4/ close the table
5/ open the table -> you get the following exception : 
It is because the children of the ITreeItemAxis are not serialized, so opening the table, we check than there is no child, but the model has been disposed so the children are always attached to their parent. -> we get the exception.

org.eclipse.core.runtime.AssertionFailedException: assertion failed: 
	at org.eclipse.core.runtime.Assert.isTrue(Assert.java:110)
	at org.eclipse.core.runtime.Assert.isTrue(Assert.java:96)
	at org.eclipse.papyrus.infra.nattable.manager.axis.AbstractTreeAxisManagerForEventList.fillChildrenForSemanticElement(AbstractTreeAxisManagerForEventList.java:334)
	at org.eclipse.papyrus.infra.nattable.manager.axis.AbstractTreeAxisManagerForEventList.fillListWithRoots(AbstractTreeAxisManagerForEventList.java:414)
	at org.eclipse.papyrus.infra.nattable.manager.axis.CompositeTreeAxisManagerForEventList.fillListWithRoots(CompositeTreeAxisManagerForEventList.java:221)
	at org.eclipse.papyrus.infra.nattable.manager.axis.CompositeTreeAxisManagerForEventList.setSubManagers(CompositeTreeAxisManagerForEventList.java:67)
	at org.eclipse.papyrus.infra.nattable.manager.table.TreeNattableModelManager.createAxisManager(TreeNattableModelManager.java:212)
	at org.eclipse.papyrus.infra.nattable.manager.table.NattableModelManager.init(NattableModelManager.java:705)
	at org.eclipse.papyrus.infra.nattable.manager.table.NattableModelManager.<init>(NattableModelManager.java:268)
	at org.eclipse.papyrus.infra.nattable.manager.table.TreeNattableModelManager.<init>(TreeNattableModelManager.java:106)
	at org.eclipse.papyrus.infra.nattable.utils.NattableModelManagerFactory.createNatTableModelManager(NattableModelManagerFactory.java:43)
	at org.eclipse.papyrus.infra.nattable.common.editor.AbstractEMFNattableEditor.<init>(AbstractEMFNattableEditor.java:85)
	at org.eclipse.papyrus.infra.nattable.common.editor.NatTableEditor.<init>(NatTableEditor.java:35)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
	at org.eclipse.papyrus.infra.nattable.common.factory.NattableEditorFactory$NattableEditorModel.createIEditorPart(NattableEditorFactory.java:127)
	at org.eclipse.papyrus.infra.core.sasheditor.internal.EditorPart.createIEditorPart(EditorPart.java:274)
	at org.eclipse.papyrus.infra.core.sasheditor.internal.EditorPart.createPartControl(EditorPart.java:197)
	at org.eclipse.papyrus.infra.core.sasheditor.internal.TabFolderPart.createChildPart(TabFolderPart.java:1065)
	at org.eclipse.papyrus.infra.core.sasheditor.internal.TabFolderPart.createTabItem(TabFolderPart.java:986)
	at org.eclipse.papyrus.infra.core.sasheditor.internal.TabFolderPart.synchronize2(TabFolderPart.java:900)
	at org.eclipse.papyrus.infra.core.sasheditor.internal.RootPart.synchronize2(RootPart.java:139)
	at org.eclipse.papyrus.infra.core.sasheditor.internal.SashWindowsContainer.refreshTabsInternal(SashWindowsContainer.java:709)
	at org.eclipse.papyrus.infra.core.sasheditor.internal.SashWindowsContainer.refreshTabs(SashWindowsContainer.java:663)
	at org.eclipse.papyrus.infra.core.sasheditor.editor.AbstractMultiPageSashEditor.doRefreshTabs(AbstractMultiPageSashEditor.java:245)
	at org.eclipse.papyrus.infra.core.sasheditor.editor.AbstractMultiPageSashEditor.access$1(AbstractMultiPageSashEditor.java:243)
	at org.eclipse.papyrus.infra.core.sasheditor.editor.AbstractMultiPageSashEditor$2.run(AbstractMultiPageSashEditor.java:238)
	at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:186)
	at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:145)
	at org.eclipse.swt.widgets.Display.syncExec(Display.java:4761)
	at org.eclipse.papyrus.infra.core.sasheditor.editor.AbstractMultiPageSashEditor.refreshTabs(AbstractMultiPageSashEditor.java:234)
	at org.eclipse.papyrus.infra.core.editor.CoreMultiDiagramEditor.refreshTabs(CoreMultiDiagramEditor.java:1123)
	at org.eclipse.papyrus.infra.core.editor.CoreMultiDiagramEditor$5.run(CoreMultiDiagramEditor.java:1112)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4155)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3772)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1127)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1018)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:156)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:654)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:598)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:139)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:653)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:608)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1499)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1472)
Comment 1 Vincent Lorenzo CLA 2015-05-20 08:46:14 EDT
I see to possible fixes : 
	1/ clear the children list in the dispose method of TreeNattableModelManager
		- it will fix the bug
		- it will allow to dispose the children (all ITreeItemAxis with depth!=0), so it will improve the memory consumption
	2/ remove the assert in the code and update the list of elements when we reopen the table
		- it will fix the bug
		- will take more time during the opening of the table
Comment 2 Vincent Lorenzo CLA 2015-05-20 09:08:31 EDT
Fixed with the first solution in commit f20b1883b3c517669823f2f1d5bb85d87482422a on master
reported on bugs/439888/filterInLuna102 in commit 9067a0a1a7088b72239b579a950bd0ddd303fe7f

This bug can be marked as closed fixed.
Comment 3 Vincent Lorenzo CLA 2015-05-20 09:34:14 EDT
I reopen the bug, because we should provide JUnit tests for this bug
Comment 4 Eclipse Genie CLA 2015-11-27 07:31:39 EST
New Gerrit change created: https://git.eclipse.org/r/61448
Comment 6 Eclipse Genie CLA 2016-01-08 19:32:23 EST
New Gerrit change created: https://git.eclipse.org/r/63911
Comment 7 Eclipse Genie CLA 2016-01-11 04:07:15 EST
Gerrit change https://git.eclipse.org/r/63911 was merged to [streams/1.1-maintenance].
Commit: http://git.eclipse.org/c/papyrus/org.eclipse.papyrus.git/commit/?id=c7d60d9b7e13e5cc169a1374538cad0e26f786b1
Comment 8 Vincent Lorenzo CLA 2016-01-11 04:07:51 EST
This bug can be marked as closed fixed.
Comment 9 Vincent Lorenzo CLA 2016-02-08 07:20:22 EST
*** Bug 466606 has been marked as a duplicate of this bug. ***