Bug 427435 - Unexpected dirty state after opening a table
Summary: Unexpected dirty state after opening a table
Status: NEW
Alias: None
Product: Sirius
Classification: Modeling
Component: Table (show other bugs)
Version: 1.0.0M5   Edit
Hardware: PC Linux
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2014-02-05 02:40 EST by Laurent Redor CLA
Modified: 2018-12-17 11:10 EST (History)
2 users (show)

See Also:


Attachments
Project to import for reproduction steps (2.04 KB, application/zip)
2014-02-05 02:40 EST, Laurent Redor CLA
no flags Details
Juno3 Stack: The method DTableViewerListener.controlResized is called twice before calling AbstractDTreeEditor.enablePropertiesUpdate() (13.45 KB, text/plain)
2014-02-05 02:53 EST, Laurent Redor CLA
no flags Details
Kepler stack: the method AbstractDTreeEditor.enablePropertiesUpdate() is called before the DTableViewerListener.controlResized calls (9.57 KB, text/plain)
2014-02-05 02:55 EST, Laurent Redor CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Laurent Redor CLA 2014-02-05 02:40:01 EST
Created attachment 239647 [details]
Project to import for reproduction steps

There is a regression since Kepler (no present on Juno3) on Linux.

Steps to reproduce:
* Open the Modeling project contained in the useCase.zip
* Open the representation "new EditionTable"
* The session is dirty : KO
* If you save the session, the representations.aird file is the same. There is no real change.

Ditto for "new CrossTable"

This problem seems to exist only for table with one column or only with header column. This is not usual. This explains the minor severity.
Comment 1 Laurent Redor CLA 2014-02-05 02:49:53 EST
Primary analysis:

The behavior of org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor() has changed between Juno3 and Kepler. A part of Sirius code depends on the events order from busyOpenEditor() : 
* org.eclipse.sirius.table.ui.tools.internal.editor.RefreshAtOpeningActivator.partOpened(IWorkbenchPart)
* org.eclipse.sirius.table.ui.tools.internal.editor.RefreshAtOpeningActivator.partActivated(IWorkbenchPart)

Since Kepler, the order is not the same, so when the method 
org.eclipse.sirius.table.ui.tools.internal.editor.listeners.DTableViewerListener.controlResized(ControlEvent)
is called, the dTableViewerManager.getEditor().isPropertiesUpdateEnabled() has not the expected value (not the same as in Juno3).

This method is called twice:
* firstly with a widgetWidth different from the current column width: that calls a ChangeColumnWidthCommand and the session passes dirty
* secondly with a widgetWidth equal to the original column width: that calls again ChangeColumnWidthCommand and resets the value to the original value. This explains that there is no difference in the representations.aird file after saving.
Comment 2 Laurent Redor CLA 2014-02-05 02:53:29 EST
Created attachment 239648 [details]
Juno3 Stack: The method DTableViewerListener.controlResized is called twice before calling AbstractDTreeEditor.enablePropertiesUpdate()
Comment 3 Laurent Redor CLA 2014-02-05 02:55:55 EST
Created attachment 239649 [details]
Kepler stack: the method AbstractDTreeEditor.enablePropertiesUpdate() is called before the DTableViewerListener.controlResized calls
Comment 4 Laurent Redor CLA 2014-02-05 02:56:29 EST
Comment on attachment 239648 [details]
Juno3 Stack: The method DTableViewerListener.controlResized is called twice before calling AbstractDTreeEditor.enablePropertiesUpdate()

>Juno3 stack: the method DTableViewerListener.controlResized is called twice before calling AbstractDTreeEditor.enablePropertiesUpdate()
>
>Thread [main] (Suspended (breakpoint at line 119 in org.eclipse.sirius.table.ui.tools.internal.editor.listeners.DTableViewerListener))	
>	org.eclipse.sirius.table.ui.tools.internal.editor.listeners.DTableViewerListener.controlResized(org.eclipse.swt.events.ControlEvent) line: 119	
>	org.eclipse.swt.widgets.TypedListener.handleEvent(org.eclipse.swt.widgets.Event) line: 235	
>	org.eclipse.swt.widgets.EventTable.sendEvent(org.eclipse.swt.widgets.Event) line: 84	
>	org.eclipse.swt.widgets.TreeColumn(org.eclipse.swt.widgets.Widget).sendEvent(org.eclipse.swt.widgets.Event) line: 1276	
>	org.eclipse.swt.widgets.TreeColumn(org.eclipse.swt.widgets.Widget).sendEvent(int, org.eclipse.swt.widgets.Event, boolean) line: 1300	
>	org.eclipse.swt.widgets.TreeColumn(org.eclipse.swt.widgets.Widget).sendEvent(int) line: 1281	
>	org.eclipse.swt.widgets.TreeColumn.gtk_size_allocate(long, long) line: 401	
>	org.eclipse.swt.widgets.TreeColumn(org.eclipse.swt.widgets.Widget).windowProc(long, long, long) line: 1784	
>	org.eclipse.swt.widgets.Display.windowProc(long, long, long) line: 4377	
>	org.eclipse.swt.internal.gtk.OS._Call(long, long, long) line: not available [native method]	
>	org.eclipse.swt.internal.gtk.OS.Call(long, long, long) line: 798	
>	org.eclipse.swt.widgets.Tree(org.eclipse.swt.widgets.Widget).fixedSizeAllocateProc(long, long) line: 928	
>	org.eclipse.swt.widgets.Display.fixedSizeAllocateProc(long, long) line: 1294	
>	org.eclipse.swt.internal.gtk.OS._gtk_widget_size_allocate(long, org.eclipse.swt.internal.gtk.GtkAllocation) line: not available [native method]	
>	org.eclipse.swt.internal.gtk.OS.gtk_widget_size_allocate(long, org.eclipse.swt.internal.gtk.GtkAllocation) line: 13481	
>	org.eclipse.swt.widgets.Tree(org.eclipse.swt.widgets.Control).setBounds(int, int, int, int, boolean, boolean) line: 908	
>	org.eclipse.swt.widgets.Tree(org.eclipse.swt.widgets.Composite).setBounds(int, int, int, int, boolean, boolean) line: 1365	
>	org.eclipse.swt.widgets.Tree.setBounds(int, int, int, int, boolean, boolean) line: 2910	
>	org.eclipse.swt.widgets.Tree(org.eclipse.swt.widgets.Control).setSize(int, int) line: 1127	
>	org.eclipse.jface.layout.TreeColumnLayout(org.eclipse.jface.layout.AbstractColumnLayout).layoutTableTree(org.eclipse.swt.widgets.Scrollable, int, org.eclipse.swt.graphics.Rectangle, boolean) line: 207	
>	org.eclipse.jface.layout.TreeColumnLayout(org.eclipse.jface.layout.AbstractColumnLayout).layout(org.eclipse.swt.widgets.Composite, boolean) line: 247	
>	org.eclipse.jface.layout.TreeColumnLayout.layout(org.eclipse.swt.widgets.Composite, boolean) line: 69	
>	org.eclipse.swt.widgets.Composite.updateLayout(boolean) line: 1570	
>	org.eclipse.swt.widgets.Composite.setBounds(int, int, int, int, boolean, boolean) line: 1368	
>	org.eclipse.swt.widgets.Composite(org.eclipse.swt.widgets.Control).setBounds(int, int, int, int) line: 797	
>	org.eclipse.swt.layout.FillLayout.layout(org.eclipse.swt.widgets.Composite, boolean) line: 201	
>	org.eclipse.swt.widgets.Composite.updateLayout(boolean) line: 1570	
>	org.eclipse.swt.widgets.Composite.setBounds(int, int, int, int, boolean, boolean) line: 1368	
>	org.eclipse.swt.widgets.Composite(org.eclipse.swt.widgets.Control).setBounds(org.eclipse.swt.graphics.Rectangle) line: 769	
>	org.eclipse.ui.internal.EditorPane(org.eclipse.ui.internal.LayoutPart).setBounds(org.eclipse.swt.graphics.Rectangle) line: 300	
>	org.eclipse.ui.internal.presentations.PresentablePart.setBounds(org.eclipse.swt.graphics.Rectangle) line: 170	
>	org.eclipse.ui.internal.presentations.util.PresentablePartFolder.layoutContent() line: 131	
>	org.eclipse.ui.internal.presentations.util.PresentablePartFolder.layout(boolean) line: 412	
>	org.eclipse.ui.internal.presentations.util.PresentablePartFolder.select(org.eclipse.ui.presentations.IPresentablePart) line: 292	
>	org.eclipse.ui.internal.presentations.util.LeftToRightTabOrder.select(org.eclipse.ui.presentations.IPresentablePart) line: 65	
>	org.eclipse.ui.internal.presentations.util.TabbedStackPresentation.selectPart(org.eclipse.ui.presentations.IPresentablePart) line: 473	
>	org.eclipse.ui.internal.EditorStack(org.eclipse.ui.internal.PartStack).refreshPresentationSelection() line: 1245	
>	org.eclipse.ui.internal.EditorStack(org.eclipse.ui.internal.PartStack).setSelection(org.eclipse.ui.internal.LayoutPart) line: 1198	
>	org.eclipse.ui.internal.EditorStack(org.eclipse.ui.internal.PartStack).showPart(org.eclipse.ui.internal.LayoutPart, java.lang.Object) line: 1597	
>	org.eclipse.ui.internal.EditorStack(org.eclipse.ui.internal.PartStack).add(org.eclipse.ui.internal.LayoutPart, java.lang.Object) line: 493	
>	org.eclipse.ui.internal.EditorStack.add(org.eclipse.ui.internal.LayoutPart, java.lang.Object) line: 103	
>	org.eclipse.ui.internal.EditorStack(org.eclipse.ui.internal.PartStack).add(org.eclipse.ui.internal.LayoutPart) line: 479	
>	org.eclipse.ui.internal.EditorStack.add(org.eclipse.ui.internal.LayoutPart) line: 112	
>	org.eclipse.ui.internal.EditorSashContainer.addEditor(org.eclipse.ui.internal.EditorPane, org.eclipse.ui.internal.EditorStack) line: 63	
>	org.eclipse.ui.internal.EditorAreaHelper.addToLayout(org.eclipse.ui.internal.EditorPane, org.eclipse.ui.internal.EditorStack) line: 225	
>	org.eclipse.ui.internal.EditorAreaHelper.addEditor(org.eclipse.ui.internal.EditorReference, java.lang.String, boolean) line: 213	
>	org.eclipse.ui.internal.EditorManager.createEditorTab(org.eclipse.ui.internal.EditorReference, java.lang.String) line: 808	
>	org.eclipse.ui.internal.EditorManager.openEditorFromDescriptor(org.eclipse.ui.internal.registry.EditorDescriptor, org.eclipse.ui.IEditorInput, org.eclipse.ui.IMemento) line: 707	
>	org.eclipse.ui.internal.EditorManager.openEditor(java.lang.String, org.eclipse.ui.IEditorInput, boolean, org.eclipse.ui.IMemento) line: 666	
>	org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(org.eclipse.ui.IEditorInput, java.lang.String, boolean, int, org.eclipse.ui.IMemento) line: 2955	
>	org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(org.eclipse.ui.IEditorInput, java.lang.String, boolean, int, org.eclipse.ui.IMemento) line: 2863	
>	org.eclipse.ui.internal.WorkbenchPage.access$11(org.eclipse.ui.internal.WorkbenchPage, org.eclipse.ui.IEditorInput, java.lang.String, boolean, int, org.eclipse.ui.IMemento) line: 2855	
>	org.eclipse.ui.internal.WorkbenchPage$10.run() line: 2806	
>	org.eclipse.swt.custom.BusyIndicator.showWhile(org.eclipse.swt.widgets.Display, java.lang.Runnable) line: 70	
>	org.eclipse.ui.internal.WorkbenchPage.openEditor(org.eclipse.ui.IEditorInput, java.lang.String, boolean, int, org.eclipse.ui.IMemento) line: 2802	
>	org.eclipse.ui.internal.WorkbenchPage.openEditor(org.eclipse.ui.IEditorInput, java.lang.String, boolean, int) line: 2786	
>	org.eclipse.ui.internal.WorkbenchPage.openEditor(org.eclipse.ui.IEditorInput, java.lang.String) line: 2769	
>	org.eclipse.sirius.table.ui.business.internal.dialect.TableDialectUIServices$1.run() line: 109	
>	org.eclipse.ui.internal.UISynchronizer(org.eclipse.swt.widgets.Synchronizer).syncExec(java.lang.Runnable) line: 180	
>	org.eclipse.ui.internal.UISynchronizer.syncExec(java.lang.Runnable) line: 150	
>	org.eclipse.swt.widgets.Display.syncExec(java.lang.Runnable) line: 4299	
>	org.eclipse.sirius.table.ui.business.internal.dialect.TableDialectUIServices.openEditor(org.eclipse.sirius.business.api.session.Session, org.eclipse.sirius.viewpoint.DRepresentation, org.eclipse.core.runtime.IProgressMonitor) line: 115	
>	org.eclipse.sirius.ui.business.internal.dialect.DialectUIManagerImpl.openEditor(org.eclipse.sirius.business.api.session.Session, org.eclipse.sirius.viewpoint.DRepresentation, org.eclipse.core.runtime.IProgressMonitor) line: 95	
>	org.eclipse.sirius.ui.tools.internal.actions.session.OpenRepresentationsAction.openRepresentations(java.util.Collection<org.eclipse.sirius.viewpoint.DRepresentation>, org.eclipse.core.runtime.IProgressMonitor) line: 113	
>	org.eclipse.sirius.ui.tools.internal.actions.session.OpenRepresentationsAction.access$1(org.eclipse.sirius.ui.tools.internal.actions.session.OpenRepresentationsAction, java.util.Collection, org.eclipse.core.runtime.IProgressMonitor) line: 100	
>	org.eclipse.sirius.ui.tools.internal.actions.session.OpenRepresentationsAction$1.run(org.eclipse.core.runtime.IProgressMonitor) line: 83	
>	org.eclipse.jface.operation.ModalContext.runInCurrentThread(org.eclipse.jface.operation.IRunnableWithProgress, org.eclipse.core.runtime.IProgressMonitor) line: 464	
>	org.eclipse.jface.operation.ModalContext.run(org.eclipse.jface.operation.IRunnableWithProgress, boolean, org.eclipse.core.runtime.IProgressMonitor, org.eclipse.swt.widgets.Display) line: 372	
>	org.eclipse.jface.dialogs.ProgressMonitorDialog.run(boolean, boolean, org.eclipse.jface.operation.IRunnableWithProgress) line: 507	
>	org.eclipse.ui.internal.progress.ProgressManager$RunnableWithStatus.run() line: 1346	
>	org.eclipse.swt.custom.BusyIndicator.showWhile(org.eclipse.swt.widgets.Display, java.lang.Runnable) line: 70	
>	org.eclipse.ui.internal.progress.ProgressManager$7.run() line: 1184	
>	org.eclipse.ui.internal.UISynchronizer(org.eclipse.swt.widgets.Synchronizer).syncExec(java.lang.Runnable) line: 180	
>	org.eclipse.ui.internal.UISynchronizer.syncExec(java.lang.Runnable) line: 150	
>	org.eclipse.swt.widgets.Display.syncExec(java.lang.Runnable) line: 4299	
>	org.eclipse.ui.internal.progress.ProgressManager.runInUI(org.eclipse.jface.operation.IRunnableContext, org.eclipse.jface.operation.IRunnableWithProgress, org.eclipse.core.runtime.jobs.ISchedulingRule) line: 1182	
>	org.eclipse.sirius.ui.tools.internal.actions.session.OpenRepresentationsAction.run() line: 86	
>	org.eclipse.sirius.ui.tools.internal.views.common.navigator.OpenRepresentationListener.doubleClick(org.eclipse.jface.viewers.DoubleClickEvent) line: 42	
>	org.eclipse.jface.viewers.StructuredViewer$1.run() line: 845	
>	org.eclipse.core.runtime.SafeRunner.run(org.eclipse.core.runtime.ISafeRunnable) line: 42	
>	org.eclipse.ui.internal.JFaceUtil$1.run(org.eclipse.core.runtime.ISafeRunnable) line: 49	
>	org.eclipse.jface.util.SafeRunnable.run(org.eclipse.core.runtime.ISafeRunnable) line: 175	
>	org.eclipse.sirius.ui.tools.internal.views.common.navigator.filter.FilteredCommonTree$NotifyingCommonViewer(org.eclipse.jface.viewers.StructuredViewer).fireDoubleClick(org.eclipse.jface.viewers.DoubleClickEvent) line: 843	
>	org.eclipse.sirius.ui.tools.internal.views.common.navigator.filter.FilteredCommonTree$NotifyingCommonViewer(org.eclipse.jface.viewers.AbstractTreeViewer).handleDoubleSelect(org.eclipse.swt.events.SelectionEvent) line: 1477	
>	org.eclipse.sirius.ui.tools.internal.views.common.navigator.filter.FilteredCommonTree$NotifyingCommonViewer(org.eclipse.ui.navigator.CommonViewer).handleDoubleSelect(org.eclipse.swt.events.SelectionEvent) line: 454	
>	org.eclipse.jface.viewers.StructuredViewer$4.widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent) line: 1246	
>	org.eclipse.jface.util.OpenStrategy.fireDefaultSelectionEvent(org.eclipse.swt.events.SelectionEvent) line: 249	
>	org.eclipse.jface.util.OpenStrategy.access$0(org.eclipse.jface.util.OpenStrategy, org.eclipse.swt.events.SelectionEvent) line: 246	
>	org.eclipse.jface.util.OpenStrategy$1.handleEvent(org.eclipse.swt.widgets.Event) line: 307	
>	org.eclipse.swt.widgets.EventTable.sendEvent(org.eclipse.swt.widgets.Event) line: 84	
>	org.eclipse.swt.widgets.Tree(org.eclipse.swt.widgets.Widget).sendEvent(org.eclipse.swt.widgets.Event) line: 1276	
>	org.eclipse.swt.widgets.Display.runDeferredEvents() line: 3562	
>	org.eclipse.swt.widgets.Display.readAndDispatch() line: 3186	
>	org.eclipse.ui.internal.Workbench.runEventLoop(org.eclipse.jface.window.Window$IExceptionHandler, org.eclipse.swt.widgets.Display) line: 2701	
>	org.eclipse.ui.internal.Workbench.runUI() line: 2665	
>	org.eclipse.ui.internal.Workbench.access$4(org.eclipse.ui.internal.Workbench) line: 2499	
>	org.eclipse.ui.internal.Workbench$7.run() line: 679	
>	org.eclipse.core.databinding.observable.Realm.runWithDefault(org.eclipse.core.databinding.observable.Realm, java.lang.Runnable) line: 332	
>	org.eclipse.ui.internal.Workbench.createAndRunWorkbench(org.eclipse.swt.widgets.Display, org.eclipse.ui.application.WorkbenchAdvisor) line: 668	
>	org.eclipse.ui.PlatformUI.createAndRunWorkbench(org.eclipse.swt.widgets.Display, org.eclipse.ui.application.WorkbenchAdvisor) line: 149	
>	org.eclipse.ui.internal.ide.application.IDEApplication.start(org.eclipse.equinox.app.IApplicationContext) line: 124	
>	org.eclipse.equinox.internal.app.EclipseAppHandle.run(java.lang.Object) line: 196	
>	org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(java.lang.Object) line: 110	
>	org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(java.lang.Object) line: 79	
>	org.eclipse.core.runtime.adaptor.EclipseStarter.run(java.lang.Object) line: 353	
>	org.eclipse.core.runtime.adaptor.EclipseStarter.run(java.lang.String[], java.lang.Runnable) line: 180	
>	sun.reflect.NativeMethodAccessorImpl.invoke0(java.lang.reflect.Method, java.lang.Object, java.lang.Object[]) line: not available [native method]	
>	sun.reflect.NativeMethodAccessorImpl.invoke(java.lang.Object, java.lang.Object[]) line: 57	
>	sun.reflect.DelegatingMethodAccessorImpl.invoke(java.lang.Object, java.lang.Object[]) line: 43	
>	java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object...) line: 606	
>	org.eclipse.equinox.launcher.Main.invokeFramework(java.lang.String[], java.net.URL[]) line: 629	
>	org.eclipse.equinox.launcher.Main.basicRun(java.lang.String[]) line: 584	
>	org.eclipse.equinox.launcher.Main.run(java.lang.String[]) line: 1438	
>	org.eclipse.equinox.launcher.Main.main(java.lang.String[]) line: 1414	
>
Comment 5 Laurent Redor CLA 2014-02-05 02:59:11 EST
Sorry for the comment 4, it's a mistake. I had a problem during using bugzilla.