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

Bug 499928

Summary: Synchronization Exception with Compartments
Product: [Modeling] Sirius Reporter: Frederic Madiot <frederic.madiot>
Component: DiagramAssignee: Project Inbox <sirius.diagram-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: frederic.gurr, maxime.porhel, steve.monnier
Version: 4.0.0Keywords: triaged
Target Milestone: ---   
Hardware: PC   
OS: Windows NT   
Whiteboard:
Bug Depends on: 485426, 500124    
Bug Blocks:    
Attachments:
Description Flags
reproduction case none

Description Frederic Madiot CLA 2016-08-18 12:19:19 EDT
Created attachment 263654 [details]
reproduction case

When modifying the resource externaly (via the default editor or an xtext editor for example), a diagram containing a stack is not refreshed and an exception occurs :


org.eclipse.emf.common.util.WrappedException: An exception was ignored during command execution
	at org.eclipse.emf.common.command.BasicCommandStack.handleError(BasicCommandStack.java:281)
	at org.eclipse.emf.transaction.impl.AbstractTransactionalCommandStack.handleError(AbstractTransactionalCommandStack.java:125)
	at org.eclipse.emf.transaction.impl.AbstractTransactionalCommandStack.execute(AbstractTransactionalCommandStack.java:229)
	at org.eclipse.sirius.tools.api.ui.RefreshEditorsPrecommitListener.notify(RefreshEditorsPrecommitListener.java:282)
	at org.eclipse.sirius.business.internal.session.danalysis.DAnalysisSessionImpl.notifyListeners(DAnalysisSessionImpl.java:1019)
	at org.eclipse.sirius.business.internal.session.danalysis.SessionResourcesSynchronizer.reloadResource(SessionResourcesSynchronizer.java:224)
	at org.eclipse.sirius.business.internal.session.danalysis.SessionResourcesSynchronizer.processAction(SessionResourcesSynchronizer.java:170)
	at org.eclipse.sirius.business.internal.session.danalysis.SessionResourcesSynchronizer.processActions(SessionResourcesSynchronizer.java:159)
	at org.eclipse.sirius.business.internal.session.danalysis.SessionResourcesSynchronizer.statusesChanged(SessionResourcesSynchronizer.java:108)
	at org.eclipse.sirius.common.tools.api.resource.ResourceSetSync.notifyClientsInBatch(ResourceSetSync.java:392)
	at org.eclipse.sirius.common.tools.api.resource.ResourceSetSync.statusesChanged(ResourceSetSync.java:447)
	at org.eclipse.sirius.common.tools.internal.resource.ResourceSyncClientNotifier.run(ResourceSyncClientNotifier.java:77)
	at org.eclipse.sirius.common.tools.internal.resource.EditingSessionWorkspaceListener.resourceChanged(EditingSessionWorkspaceListener.java:59)
	at org.eclipse.core.internal.events.NotificationManager$1.run(NotificationManager.java:299)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.core.internal.events.NotificationManager.notify(NotificationManager.java:289)
	at org.eclipse.core.internal.events.NotificationManager.broadcastChanges(NotificationManager.java:152)
	at org.eclipse.core.internal.resources.Workspace.broadcastPostChange(Workspace.java:374)
	at org.eclipse.core.internal.resources.Workspace.endOperation(Workspace.java:1469)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2253)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2267)
	at org.eclipse.ui.actions.WorkspaceModifyOperation.run(WorkspaceModifyOperation.java:128)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:119)
Caused by: org.eclipse.emf.transaction.RollbackException: Uncaught exception during pre-commit trigger processing
	at org.eclipse.emf.workspace.impl.WorkspaceCommandStackImpl.doExecute(WorkspaceCommandStackImpl.java:213)
	at org.eclipse.emf.transaction.impl.AbstractTransactionalCommandStack.execute(AbstractTransactionalCommandStack.java:165)
	at org.eclipse.emf.transaction.impl.AbstractTransactionalCommandStack.execute(AbstractTransactionalCommandStack.java:219)
	... 20 more


Way to reproduce :
The attached example contains a VSM with two diagrams (FreeForm and Stack).
With a FreeForm diagram on a EPackage, when you use the default editor to add or remove Eclasses all is ok.
Now if you do the same with a Stack diagram you get the exception.
Comment 1 Maxime Porhel CLA 2016-08-23 05:06:35 EDT
See Bug 485426 which corrects the underlying ClassCastException on master for 4.1. 

This bugzilla isnot closed as duplicate but stay opened as candidate for a backport on Sirius 4.0.x.
Comment 2 Maxime Porhel CLA 2016-08-23 05:07:06 EDT
Thread [ModalContext] (Suspended (exception ClassCastException))	
	owns: EcoreEditor$16  (id=275)	
	GMFHelper.getGraphicalEditPart(View) line: 646	
	GMFHelper.replaceAutoSize(Node, Rectangle, boolean, Dimension) line: 496	
	GMFHelper.getBounds(Node, boolean, boolean) line: 462	
	RegionContainerUpdateLayoutOperation.updateRegionsLayoutContraints(List<Node>, boolean) line: 115	
	RegionContainerUpdateLayoutOperation.execute() line: 97	
	DDiagramCanonicalSynchronizer.manageRegions() line: 142	
	DDiagramCanonicalSynchronizer.refreshSemantic() line: 126	
	DDiagramCanonicalSynchronizer.synchronize() line: 106	
	SynchronizeGMFModelCommand.doExecute() line: 44	
	SynchronizeGMFModelCommand(RecordingCommand).execute() line: 135	
	CompoundCommand.execute() line: 261	
	TriggerCommand.execute() line: 113	
	WorkspaceCommandStackImpl.executeTriggers(Command, List<Command>, Map<?,?>) line: 398	
	TransactionalEditingDomainImpl.precommit(InternalTransaction) line: 712	
	EMFOperationTransaction(TransactionImpl).commit() line: 414	
	EMFCommandOperation(AbstractEMFOperation).execute(IProgressMonitor, IAdaptable) line: 155	
	DefaultOperationHistory.execute(IUndoableOperation, IProgressMonitor, IAdaptable) line: 488	
	WorkspaceCommandStackImpl.doExecute(Command, Map<?,?>) line: 208	
	WorkspaceCommandStackImpl(AbstractTransactionalCommandStack).execute(Command, Map<?,?>) line: 165	
	WorkspaceCommandStackImpl(AbstractTransactionalCommandStack).execute(Command) line: 219	
	RefreshEditorsPrecommitListener.notify(int) line: 282	
	DAnalysisSessionImpl.notifyListeners(int) line: 1019	
	SessionResourcesSynchronizer.reloadResource(Resource) line: 224	
	SessionResourcesSynchronizer.processAction(ReloadingPolicy$Action, Resource, IProgressMonitor) line: 170	
	SessionResourcesSynchronizer.processActions(List<Action>, Resource, IProgressMonitor) line: 159	
	SessionResourcesSynchronizer.statusesChanged(Collection<ResourceStatusChange>) line: 108	
	ResourceSetSync.notifyClientsInBatch(Collection<ResourceStatusChange>) line: 392	
	ResourceSetSync.statusesChanged(Collection<ResourceStatusChange>) line: 447	
	ResourceSyncClientNotifier.run(IProgressMonitor) line: 77	
	EditingSessionWorkspaceListener.resourceChanged(IResourceChangeEvent) line: 59	
	NotificationManager$1.run() line: 299	
	SafeRunner.run(ISafeRunnable) line: 42	
	NotificationManager.notify(ResourceChangeListenerList$ListenerEntry[], ResourceChangeEvent, boolean) line: 289	
	NotificationManager.broadcastChanges(ElementTree, ResourceChangeEvent, boolean) line: 152	
	Workspace.broadcastPostChange() line: 374	
	Workspace.endOperation(ISchedulingRule, boolean, IProgressMonitor) line: 1469	
	Workspace.run(ICoreRunnable, ISchedulingRule, int, IProgressMonitor) line: 2253	
	Workspace.run(IWorkspaceRunnable, ISchedulingRule, int, IProgressMonitor) line: 2267	
	EcoreEditor$16(WorkspaceModifyOperation).run(IProgressMonitor) line: 128	
	ModalContext$ModalContextThread.run() line: 119
Comment 3 Maxime Porhel CLA 2016-08-23 05:27:40 EDT
After discussion with Pierre-Charles, I close this bugzilla as duplicate of Bug 485526 which will later be cloned and backported on needed branches.

*** This bug has been marked as a duplicate of bug 485526 ***
Comment 4 Frederic Gurr CLA 2016-08-23 05:55:39 EDT
I think there was a typo in the bug number. You probably meant bug 485426 instead of bug 485526.

*** This bug has been marked as a duplicate of bug 485426 ***