Bug 514854 - Tracking bug - NPE in state machine diagram when deleting a state machine
Summary: Tracking bug - NPE in state machine diagram when deleting a state machine
Status: NEW
Alias: None
Product: Papyrus-rt
Classification: Modeling
Component: tool (show other bugs)
Version: 1.0.0   Edit
Hardware: All All
: P3 normal
Target Milestone: Future   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard: depends_on_papyrus
Keywords: readme
Depends on: 514787
Blocks:
  Show dependency tree
 
Reported: 2017-04-06 09:01 EDT by Christian Damus CLA
Modified: 2017-06-14 09:46 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Damus CLA 2017-04-06 09:01:38 EDT
+++ This bug was initially created as a clone of Bug #514787 +++

Eclipse Neon.3
Papyrus Neon.3
Papyrus-RT 0.9+ (latest git master as of 5 April 2017)

When deleting a state machine in Papyrus-RT, we get an NPE in CustomRegionPreDeleteCommand because it doesn't check whether the region shape that it's operating on still exists (has not, itself, been deleted).

Steps to reproduce:

1. Create a new UML-RT model with the "UML-RT for C++" template (enables state machines).
2. Create three capsules A, B, C with generalization relationships C --|> B --|> A.
3. In A, create a State Machine.
4. If necessary, in C create a state machine diagram for the inherited state machine.
5. Open the state machine diagram for C if it is not already open.
6. Delete A's state machine.
7. Observe the exception below, in the log.

!ENTRY org.eclipse.emf.transaction 4 45 2017-04-05 11:45:37.616
!MESSAGE Uncaught exception during post-commit listener notifications
!STACK 0
java.lang.NullPointerException
	at org.eclipse.papyrus.uml.diagram.statemachine.custom.commands.CustomRegionPreDeleteCommand.doExecuteWithResult(CustomRegionPreDeleteCommand.java:51)
	at org.eclipse.papyrus.uml.diagram.statemachine.custom.commands.CustomRegionDeleteCommand.doExecuteWithResult(CustomRegionDeleteCommand.java:37)
	at org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand.doExecute(AbstractTransactionalCommand.java:247)
	at org.eclipse.emf.workspace.AbstractEMFOperation.execute(AbstractEMFOperation.java:150)
	at org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy.execute(ICommandProxy.java:68)
	at org.eclipse.gef.commands.CompoundCommand.execute(CompoundCommand.java:129)
	at org.eclipse.papyrus.uml.diagram.common.editpolicies.OrphanViewPolicy$1.doExecute(OrphanViewPolicy.java:260)
	at org.eclipse.emf.workspace.AbstractEMFOperation.execute(AbstractEMFOperation.java:150)
	at org.eclipse.papyrus.uml.diagram.common.editpolicies.OrphanViewPolicy.executeCommand(OrphanViewPolicy.java:266)
	at org.eclipse.papyrus.uml.diagram.common.editpolicies.OrphanViewPolicy.deleteViews(OrphanViewPolicy.java:227)
	at org.eclipse.papyrus.uml.diagram.common.editpolicies.OrphanViewPolicy.notifyChanged(OrphanViewPolicy.java:410)
	at org.eclipse.gmf.runtime.diagram.core.listener.DiagramEventBroker.fireNotification(DiagramEventBroker.java:504)
	at org.eclipse.gmf.runtime.diagram.core.listener.DiagramEventBroker.resourceSetChanged(DiagramEventBroker.java:399)
	at org.eclipse.gmf.runtime.diagram.ui.DiagramEventBrokerThreadSafe.resourceSetChanged(DiagramEventBrokerThreadSafe.java:73)
	at org.eclipse.emf.transaction.impl.TransactionalEditingDomainImpl$1.run(TransactionalEditingDomainImpl.java:781)
	at org.eclipse.papyrus.infra.emf.readonly.PapyrusROTransactionalEditingDomain.runExclusive(PapyrusROTransactionalEditingDomain.java:271)
	at org.eclipse.emf.transaction.impl.TransactionalEditingDomainImpl.postcommit(TransactionalEditingDomainImpl.java:771)
	at org.eclipse.emf.transaction.impl.TransactionalEditingDomainImpl.deactivate(TransactionalEditingDomainImpl.java:543)
	at org.eclipse.emf.transaction.impl.TransactionImpl.close(TransactionImpl.java:712)
	at org.eclipse.emf.transaction.impl.TransactionImpl.commit(TransactionImpl.java:474)
	at org.eclipse.emf.workspace.AbstractEMFOperation.execute(AbstractEMFOperation.java:155)
	at org.eclipse.core.commands.operations.DefaultOperationHistory.execute(DefaultOperationHistory.java:488)
	at ...
Comment 1 Peter Cigehn CLA 2017-04-06 09:08:52 EDT
Can we name this tracking bug slightly different than the bug it tracks in Papyrus? Maybe with something more focused on UML-RT/Papyrus-RT, vs the more "general" summary for the Papyrus bug. 

It becomes pretty confusing with the notification mails, with the two bugs having identical title/summary (we have had that problem some time before with identical names on both the tracking bug and the bug it tracks).
Comment 2 Charles Rivet CLA 2017-05-25 13:06:29 EDT
Depends on a Papyrus bug that will not be fixed in 1.0