Community
Participate
Working Groups
Steps to reproduce: 1. Create Stereotypes for State and/or region 2. create custom palette elements with post actions (see below) 3. Create StateMachine and add a state 4. Using the palette elements add nested states or regions to the state, always if a new region is added, a NPE is thrown (see below) and no stereotype is applied. Adding a state to an existing region will work as expected. ------- Post Actions <aspectTool description="Create an element with a stereotype" iconpath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Region.gif" id="statemachine.createNodesGroup.region_1438334385223" name="Region (Region)" refToolId="statemachine.createNodesGroup.region"> <postAction id="org.eclipse.papyrus.applystereotypeactionprovider"> <stereotypesToApply> <stereotype stereotypeName="MyProfile::Region" /> </stereotypesToApply> </postAction> </aspectTool> <aspectTool description="Create an element with a stereotype" iconpath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/State.gif" id="statemachine.createNodesGroup.state_1438334388976" name="State (State)" refToolId="statemachine.createNodesGroup.state"> <postAction id="org.eclipse.papyrus.applystereotypeactionprovider"> <stereotypesToApply> <stereotype stereotypeName="MyProfile::State" /> </stereotypesToApply> </postAction> </aspectTool> ------- Stack Trace !ENTRY org.eclipse.gmf.runtime.diagram.ui 4 4 2015-07-31 12:18:48.413 !MESSAGE execute !STACK 0 org.eclipse.core.commands.ExecutionException: While executing the operation, an exception occurred at org.eclipse.core.commands.operations.DefaultOperationHistory.execute(DefaultOperationHistory.java:524) at org.eclipse.papyrus.commands.CheckedOperationHistory.execute(CheckedOperationHistory.java:184) at org.eclipse.gmf.runtime.diagram.ui.parts.DiagramCommandStack.execute(DiagramCommandStack.java:206) at org.eclipse.papyrus.commands.CheckedDiagramCommandStack.execute(CheckedDiagramCommandStack.java:52) at org.eclipse.gmf.runtime.diagram.ui.parts.DiagramCommandStack.execute(DiagramCommandStack.java:156) at org.eclipse.gef.tools.AbstractTool.executeCommand(AbstractTool.java:425) at org.eclipse.gef.tools.AbstractTool.executeCurrentCommand(AbstractTool.java:438) at org.eclipse.papyrus.uml.diagram.common.service.AspectUnspecifiedTypeCreationTool.performCreation(AspectUnspecifiedTypeCreationTool.java:145) at org.eclipse.gef.tools.CreationTool.handleButtonUp(CreationTool.java:189) at org.eclipse.gef.tools.AbstractTool.mouseUp(AbstractTool.java:1200) at org.eclipse.gef.EditDomain.mouseUp(EditDomain.java:301) at org.eclipse.gef.ui.parts.DomainEventDispatcher.dispatchMouseReleased(DomainEventDispatcher.java:380) at org.eclipse.draw2d.LightweightSystem$EventHandler.mouseUp(LightweightSystem.java:548) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:220) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4362) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1113) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4180) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3769) 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:601) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:669) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:608) at org.eclipse.equinox.launcher.Main.run(Main.java:1515) at org.eclipse.equinox.launcher.Main.main(Main.java:1488) Caused by: java.lang.NullPointerException at org.eclipse.papyrus.uml.diagram.common.commands.ApplyStereotypeCommand.doExecuteWithResult(ApplyStereotypeCommand.java:51) 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.emf.workspace.CompositeEMFOperation.doExecute(CompositeEMFOperation.java:217) at org.eclipse.emf.workspace.AbstractEMFOperation.execute(AbstractEMFOperation.java:150) at org.eclipse.gmf.runtime.common.core.command.CompositeCommand.doExecuteWithResult(CompositeCommand.java:403) at org.eclipse.gmf.runtime.common.core.command.AbstractCommand.execute(AbstractCommand.java:134) at org.eclipse.core.commands.operations.DefaultOperationHistory.execute(DefaultOperationHistory.java:516) ... 40 more