Project: mulestudio
Issue STUDIO-4172: Problem with Undo
Steps to reproduce: 1.- Create a project with 2 flows 2.- Select the 2 flows 3.- Delete them 4.- CMD + Z Issue: you get the followed exception {code} java.lang.IndexOutOfBoundsException: Index: 2, Size: 1 java.util.ArrayList.add(ArrayList.java:367) org.eclipse.gef.editparts.AbstractEditPart.reorderChild(AbstractEditPart.java:965) org.eclipse.gef.editparts.AbstractGraphicalEditPart.reorderChild(AbstractGraphicalEditPart.java:878) org.eclipse.gef.editparts.AbstractEditPart.refreshChildren(AbstractEditPart.java:776) org.mule.tooling.messageflow.editpart.MuleConfigurationEditPart.update(MuleConfigurationEditPart.java:79) java.util.Observable.notifyObservers(Observable.java:142) org.mule.tooling.model.messageflow.decorator.EntityDecorator.fireEvent(EntityDecorator.java:71) org.mule.tooling.model.messageflow.decorator.MuleConfigurationDecorator.addFlow(MuleConfigurationDecorator.java:39) org.mule.tooling.messageflow.command.DeleteFlowCommand.undo(DeleteFlowCommand.java:31) org.eclipse.gef.commands.CompoundCommand.undo(CompoundCommand.java:173) org.eclipse.gef.commands.CompoundCommand.undo(CompoundCommand.java:173) org.eclipse.gef.commands.CommandStack.undo(CommandStack.java:395) org.eclipse.gef.ui.actions.UndoAction.run(UndoAction.java:94) org.eclipse.jface.action.Action.runWithEvent(Action.java:498) org.eclipse.ui.actions.RetargetAction.runWithEvent(RetargetAction.java:230) org.eclipse.jface.commands.ActionHandler.execute(ActionHandler.java:119) org.eclipse.core.commands.Command.executeWithChecks(Command.java:499) org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508) org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169) org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeCommand(WorkbenchKeyboard.java:468) org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(WorkbenchKeyboard.java:786) org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEvent(WorkbenchKeyboard.java:885) org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequenceBindings(WorkbenchKeyboard.java:567) org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$3(WorkbenchKeyboard.java:508) org.eclipse.ui.internal.keys.WorkbenchKeyboard$KeyDownFilter.handleEvent(WorkbenchKeyboard.java:123) org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) org.eclipse.swt.widgets.Display.filterEvent(Display.java:1074) org.eclipse.swt.widgets.Display.sendEvent(Display.java:4135) org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1458) org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1481) org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1466) org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1495) org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1491) org.eclipse.swt.widgets.Canvas.sendKeyEvent(Canvas.java:497) org.eclipse.swt.widgets.Control.doCommandBySelector(Control.java:1060) org.eclipse.swt.widgets.Display.windowProc(Display.java:5587) org.eclipse.swt.internal.cocoa.OS.objc_msgSend(Native Method) org.eclipse.swt.internal.cocoa.NSResponder.interpretKeyEvents(NSResponder.java:68) org.eclipse.swt.widgets.Composite.keyDown(Composite.java:587) org.eclipse.swt.widgets.Display.windowProc(Display.java:5497) org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method) org.eclipse.swt.widgets.Widget.callSuper(Widget.java:221) org.eclipse.swt.widgets.Widget.windowSendEvent(Widget.java:2102) org.eclipse.swt.widgets.Shell.windowSendEvent(Shell.java:2299) org.eclipse.swt.widgets.Display.windowProc(Display.java:5559) org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method) org.eclipse.swt.widgets.Display.applicationSendEvent(Display.java:5004) org.eclipse.swt.widgets.Display.applicationProc(Display.java:5153) org.eclipse.swt.internal.cocoa.OS.objc_msgSend(Native Method) org.eclipse.swt.internal.cocoa.NSApplication.sendEvent(NSApplication.java:128) org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3618) org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2701) org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2665) org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2499) org.eclipse.ui.internal.Workbench$7.run(Workbench.java:679) org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:668) org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124) org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353) org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) java.lang.reflect.Method.invoke(Method.java:597) org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629) org.eclipse.equinox.launcher.Main.basicRun(Main.java:584) org.eclipse.equinox.launcher.Main.run(Main.java:1438) {code}
Story points: 5