Community
Participate
Working Groups
ContainerShape, say Pool, is created with GFRectangleFigure, GFText (part of inactive Shape) and DecoratorImageFigure. To this, new ContainerShape, say Process Step, is added which will call addChildVisual() in AbstractGraphicalEditPart. This initializes contentPaneChilds of ContainerShapeEditPart to 3. Save on Pool will remove DecoratorImageFigure. After this whenever a new Process Step containerShape is added to the Pool, indexOutOfBoundException is thrown. This issue occurs because ContainerShapeEditPart stores children count (contentPaneChilds) which is never updated once error marker is removed. But this count is updated in the Figure class in GEF. So the new process step’s index which is calculated in ContainerShapeEditPart will be greater than children size in Figure class. Below is the stack trace for the exception: !ENTRY org.eclipse.emf.transaction 4 45 2011-09-14 09:48:03.017 !MESSAGE Uncaught exception during post-commit listener notifications !STACK 0 java.lang.IndexOutOfBoundsException: Index does not exist at org.eclipse.draw2d.Figure.add(Figure.java:137) at org.eclipse.draw2d.Figure.add(Figure.java:179) at org.eclipse.gef.editparts.AbstractGraphicalEditPart.addChildVisual(AbstractGraphicalEditPart.java:205) at org.eclipse.graphiti.ui.internal.parts.ContainerShapeEditPart.addChildVisual(ContainerShapeEditPart.java:161) at org.eclipse.gef.editparts.AbstractEditPart.addChild(AbstractEditPart.java:197) at org.eclipse.gef.editparts.AbstractEditPart.refreshChildren(AbstractEditPart.java:727) at org.eclipse.graphiti.ui.internal.parts.ShapeEditPart.refreshChildren(ShapeEditPart.java:626) at org.eclipse.gef.editparts.AbstractEditPart.refresh(AbstractEditPart.java:677) at org.eclipse.gef.editparts.AbstractGraphicalEditPart.refresh(AbstractGraphicalEditPart.java:571) at org.eclipse.graphiti.ui.internal.parts.ShapeEditPart.refresh(ShapeEditPart.java:546) at org.eclipse.graphiti.ui.internal.parts.PictogramElementDelegate.refreshEditPartsForModelChildrenAndSourceConnections(PictogramElementDelegate.java:293) at org.eclipse.graphiti.ui.internal.parts.ShapeEditPart.refreshChildren(ShapeEditPart.java:629) at org.eclipse.gef.editparts.AbstractEditPart.refresh(AbstractEditPart.java:677) at org.eclipse.gef.editparts.AbstractGraphicalEditPart.refresh(AbstractGraphicalEditPart.java:571) at org.eclipse.graphiti.ui.internal.parts.ShapeEditPart.refresh(ShapeEditPart.java:546) at org.eclipse.graphiti.ui.internal.parts.DiagramEditPart.refresh(DiagramEditPart.java:181) at org.eclipse.graphiti.ui.internal.editor.DiagramEditorInternal.internalRefreshEditPart(DiagramEditorInternal.java:1203) at org.eclipse.graphiti.ui.internal.editor.DiagramEditorInternal.refresh(DiagramEditorInternal.java:1287) at org.eclipse.graphiti.ui.internal.editor.DiagramRefreshJob.runInUIThread(DiagramRefreshJob.java:99) at org.eclipse.graphiti.ui.internal.editor.DiagramChangeListener.resourceSetChanged(DiagramChangeListener.java:140) at org.eclipse.emf.transaction.impl.TransactionalEditingDomainImpl$1.run(TransactionalEditingDomainImpl.java:781) at org.eclipse.emf.transaction.impl.TransactionalEditingDomainImpl.runExclusive(TransactionalEditingDomainImpl.java:328) 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:511) at org.eclipse.emf.workspace.impl.WorkspaceCommandStackImpl.doExecute(WorkspaceCommandStackImpl.java:208) at org.eclipse.emf.transaction.impl.AbstractTransactionalCommandStack.execute(AbstractTransactionalCommandStack.java:165) at com.sap.bpl.util.BPLWorkspaceCommandStackImpl.execute(BPLWorkspaceCommandStackImpl.java:59) at org.eclipse.emf.transaction.impl.AbstractTransactionalCommandStack.execute(AbstractTransactionalCommandStack.java:219) at com.sap.bpl.util.BPLWorkspaceCommandStackImpl.execute(BPLWorkspaceCommandStackImpl.java:34) at org.eclipse.graphiti.ui.internal.editor.GFCommandStack.execute(GFCommandStack.java:108) at org.eclipse.gef.tools.AbstractTool.executeCommand(AbstractTool.java:399) at org.eclipse.gef.tools.AbstractTool.executeCurrentCommand(AbstractTool.java:411) at org.eclipse.gef.tools.CreationTool.performCreation(CreationTool.java:254) at org.eclipse.gef.tools.CreationTool.handleButtonUp(CreationTool.java:178) at org.eclipse.gef.tools.AbstractTool.mouseUp(AbstractTool.java:1064) at org.eclipse.gef.EditDomain.mouseUp(EditDomain.java:263) at org.eclipse.gef.ui.parts.DomainEventDispatcher.dispatchMouseReleased(DomainEventDispatcher.java:374) at org.eclipse.draw2d.LightweightSystem$EventHandler.mouseUp(LightweightSystem.java:538) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:207) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3910) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3503) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2405) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2221) at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:493) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
Requestor is CPL, relevant for 0.7 track
The issue occurs when a shape already has a decorator when children are added. In this case the offset is calculated wrong (takes the decorator also in account). The fix is to calculate the offset before any children are added. Fixed in head with commit 029327db60f55a9409814c7f8cabb26c5e3bd86d Author: mgorning <matthias.gorning@sap.com> 2011-09-21 15:14:04 Committer: mgorning <matthias.gorning@sap.com> 2011-09-21 15:14:04 Parent: 6a34f78d70f6cf335f49a23dbf5fd237d63b646b (.) Branches: origin/master, master
Downported the fix to the 0.8 stream (targeting for Indigo SR2): commit 981017ed972c09ac31129e327f643c9303e739d7 Author: mgorning <matthias.gorning@sap.com> 2011-09-21 15:14:04 Committer: mwenz <michael.wenz@sap.com> 2011-09-21 15:18:50 Parent: 60416b671042a808605cd52571127b50f046dd8e (Updates News&Noteworthy) Branches: origin/b0_8_x, b0_8_x
Downported the fix to the 0.7.x track (targeting for 0.7.3): commit 20071569801e9b9d49980192cc373685287644e4 Author: mgorning <matthias.gorning@sap.com> 2011-09-21 15:14:04 Committer: mwenz <michael.wenz@sap.com> 2011-09-21 15:49:53 Parent: 4e2eb2da74c71c5dff7fdde15cc328804dd78b39 (Updated versions to 0.7.2) Branches: origin/b0_7_0, b0_7_0
Issue has been fixed through all codelines
Fix was checked by CPL
Bookkeeping: Set target release: 0.8.1
Part of Graphiti 0.9.0 (Eclipse Juno)