Source:
<code>protected Command getCommand() { final CompoundCommand doStoreLayoutsCmd = new CompoundCommand("Store layouts"); doStoreLayoutsCmd.add(new Command("Clear previous layout data") { @Override public boolean canUndo() { return false; } @Override public boolean canExecute() { return super.canExecute(); } @Override public void execute() { for (SiriusLayoutDataManager layoutDataManager : LayoutDataManagerRegistry.getAllSiriusLayoutDataManagers()) { layoutDataManager.clearLayoutData(); } } }); DiagramEditPart diagramEditPart = getDiagramEditPart(); if (diagramEditPart instanceof IDDiagramEditPart) { final Option<DDiagram> diagram = ((IDDiagramEditPart) diagramEditPart).resolveDDiagram(); if (diagram.some()) { List<IGraphicalEditPart> selectedEditParts = cleanSelectedObjects(getSelectedObjects()); <START> for (Iterator<IGraphicalEditPart> iter = selectedEditParts.iterator(); iter.hasNext(); ) { <END> final IGraphicalEditPart toStore = iter.next(); doStoreLayoutsCmd.add(new ICommandProxy(new AbstractTransactionalCommand(toStore.getEditingDomain(), "Copy layout data", null) { @Override protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException { for (SiriusLayoutDataManager layoutDataManager : LayoutDataManagerRegistry.getSiriusLayoutDataManagers(diagram.get())) { layoutDataManager.storeLayoutData(toStore); } return CommandResult.newOKCommandResult(); } @Override protected IStatus doUndo(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException { for (SiriusLayoutDataManager layoutDataManager : LayoutDataManagerRegistry.getSiriusLayoutDataManagers(diagram.get())) { layoutDataManager.clearLayoutData(); } return super.doUndo(monitor, info); } })); } } } return doStoreLayoutsCmd.unwrap(); }</code><technical_language>reason enhanced for(IGEP toStore : selectedEditParts)</technical_language>

Target:
protected Command getCommand() { final CompoundCommand doStoreLayoutsCmd = new CompoundCommand("Store layouts"); doStoreLayoutsCmd.add(new Command("Clear previous layout data") { @Override public boolean canUndo() { return false; } @Override public boolean canExecute() { return super.canExecute(); } @Override public void execute() { for (SiriusLayoutDataManager layoutDataManager : LayoutDataManagerRegistry.getAllSiriusLayoutDataManagers()) { layoutDataManager.clearLayoutData(); } } }); DiagramEditPart diagramEditPart = getDiagramEditPart(); if (diagramEditPart instanceof IDDiagramEditPart) { final Option<DDiagram> diagram = ((IDDiagramEditPart) diagramEditPart).resolveDDiagram(); if (diagram.some()) { List<IGraphicalEditPart> selectedEditParts = cleanSelectedObjects(getSelectedObjects()); for (final IGraphicalEditPart toStore : selectedEditParts) { doStoreLayoutsCmd.add(new ICommandProxy(new AbstractTransactionalCommand(toStore.getEditingDomain(), "Copy layout data", null) { @Override protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException { for (SiriusLayoutDataManager layoutDataManager : LayoutDataManagerRegistry.getSiriusLayoutDataManagers(diagram.get())) { layoutDataManager.storeLayoutData(toStore); } return CommandResult.newOKCommandResult(); } @Override protected IStatus doUndo(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException { for (SiriusLayoutDataManager layoutDataManager : LayoutDataManagerRegistry.getSiriusLayoutDataManagers(diagram.get())) { layoutDataManager.clearLayoutData(); } return super.doUndo(monitor, info); } })); } } } return doStoreLayoutsCmd.unwrap(); }