Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 355679 - Index out of bounds exception when exclusive gateway is moved
Summary: Index out of bounds exception when exclusive gateway is moved
Status: CLOSED FIXED
Alias: None
Product: BPMN2Modeler
Classification: SOA
Component: UI (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Robert Brodt CLA
QA Contact:
URL: https://issues.jboss.org/browse/JBPM-...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-24 06:42 EDT by Robert Brodt CLA
Modified: 2011-11-03 08:56 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Brodt CLA 2011-08-24 06:42:34 EDT
This happens when the number of "ad hoc" anchors is > 1.
In AnchorUtil#deleteEmptyAdHocAnchors() just reverse the lower and upper bounds in the first "for" like so:

Was:
for (int i = 0; i < s.getAnchors().size(); i++)

Should be:
for (int i = s.getAnchors().size()-1; i >= 0; --i)

Stack trace follows:

org.eclipse.emf.common.util.BasicEList$BasicIndexOutOfBoundsException: index=6, size=6
at org.eclipse.emf.common.util.BasicEList.get(BasicEList.java:352)
at org.eclipse.bpmn2.modeler.core.utils.AnchorUtil.deleteEmptyAdHocAnchors(AnchorUtil.java:398)
at org.eclipse.bpmn2.modeler.core.utils.AnchorUtil.updateEdge(AnchorUtil.java:355)
at org.eclipse.bpmn2.modeler.core.utils.AnchorUtil.reConnect(AnchorUtil.java:327)
at org.eclipse.bpmn2.modeler.core.features.DefaultBpmnMoveFeature.postMoveShape(DefaultBpmnMoveFeature.java:33)
at org.eclipse.bpmn2.modeler.core.features.MoveFlowNodeFeature.postMoveShape(MoveFlowNodeFeature.java:85)
at org.eclipse.graphiti.features.impl.DefaultMoveShapeFeature.moveShape(DefaultMoveShapeFeature.java:66)
at org.eclipse.graphiti.internal.command.MoveShapeFeatureCommandWithContext.execute(MoveShapeFeatureCommandWithContext.java:81)
at org.eclipse.graphiti.internal.command.CommandContainer.execute(CommandContainer.java:81)
at org.eclipse.graphiti.ui.internal.command.GefCommandWrapper.execute(GefCommandWrapper.java:51)
at org.eclipse.graphiti.ui.internal.editor.EmfOnGefCommand.execute(EmfOnGefCommand.java:59)
at org.eclipse.graphiti.internal.command.GFPreparableCommand2.doExecute(GFPreparableCommand2.java:37)
at org.eclipse.emf.transaction.RecordingCommand.execute(RecordingCommand.java:135)
at org.eclipse.emf.workspace.EMFCommandOperation.doExecute(EMFCommandOperation.java:119)
at org.eclipse.emf.workspace.AbstractEMFOperation.execute(AbstractEMFOperation.java:150)
at org.eclipse.core.commands.operations.DefaultOperationHistory.execute(DefaultOperationHistory.java:513)
at org.eclipse.emf.workspace.impl.WorkspaceCommandStackImpl.doExecute(WorkspaceCommandStackImpl.java:208)
at org.eclipse.emf.transaction.impl.AbstractTransactionalCommandStack.execute(AbstractTransactionalCommandStack.java:165)
at org.eclipse.graphiti.ui.internal.editor.GFWorkspaceCommandStackImpl.execute(GFWorkspaceCommandStackImpl.java:71)
at org.eclipse.graphiti.ui.internal.editor.GFCommandStack.execute(GFCommandStack.java:108)
at org.eclipse.gef.tools.AbstractTool.executeCommand(AbstractTool.java:425)
at org.eclipse.gef.tools.AbstractTool.executeCurrentCommand(AbstractTool.java:438)
at org.eclipse.gef.tools.DragEditPartsTracker.performDrag(DragEditPartsTracker.java:496)
at org.eclipse.gef.tools.DragEditPartsTracker.handleButtonUp(DragEditPartsTracker.java:351)
at org.eclipse.gef.tools.AbstractTool.mouseUp(AbstractTool.java:1200)
at org.eclipse.gef.tools.SelectionTool.mouseUp(SelectionTool.java:574)
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:219)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4165)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3754)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
at org.eclipse.equinox.launcher.Main.main(Main.java:1386)