Bug 171514 GUIException when copy and paste dataset in attached report.[07]
Description: GUIException when copy and paste dataset in attached report. Build number:2.2.0.v20070124 Steps to reproduce: 1. Open attached report. 2. Select dataset new, right click and select copy. 3. Select Data Set node and right click, select paste. Expected result: Dataset new is pasted without GUIException. Actual result: GUIException throws but the dataset is pasted successfully. Error log: org.eclipse.birt.report.designer.core.runtime.GUIException: Index: 3, Size: 3 at org.eclipse.birt.report.designer.core.runtime.GUIException.createGUIException(GUIException.java:76) at org.eclipse.birt.report.designer.internal.ui.util.ExceptionHandler.handle(ExceptionHandler.java:135) at org.eclipse.birt.report.designer.internal.ui.util.ExceptionHandler.handle(ExceptionHandler.java:117) at org.eclipse.birt.report.designer.internal.ui.editors.parts.event.ModelEventManager.postModelEvent(ModelEventManager.java:131) at org.eclipse.birt.report.designer.internal.ui.editors.parts.event.ModelEventManager.postEvent(ModelEventManager.java:101) at org.eclipse.birt.report.designer.internal.ui.editors.parts.event.ModelEventManager.access$0(ModelEventManager.java:93) at org.eclipse.birt.report.designer.internal.ui.editors.parts.event.ModelEventManager$1.stackChanged(ModelEventManager.java:61) at org.eclipse.birt.report.model.activity.ActivityStack.sendNotifcations(ActivityStack.java:847) at org.eclipse.birt.report.model.activity.ActivityStack.commit(ActivityStack.java:720) at org.eclipse.birt.report.designer.util.DNDUtil.operateHandles(DNDUtil.java:299) at org.eclipse.birt.report.designer.util.DNDUtil.copyHandles(DNDUtil.java:128) at org.eclipse.birt.report.designer.util.DNDUtil.copyHandles(DNDUtil.java:162) at org.eclipse.birt.report.designer.internal.ui.views.actions.PasteAction.run(PasteAction.java:72) at org.eclipse.jface.action.Action.runWithEvent(Action.java:499) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:545) at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:490) at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:402) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3465) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3079) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1945) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1909) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:425) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.eclipse.equinox.internal.app.EclipseAppContainer.callMethod(EclipseAppContainer.java:522) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:147) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:104) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:74) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:354) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:170) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.eclipse.core.launcher.Main.invokeFramework(Main.java:339) at org.eclipse.core.launcher.Main.basicRun(Main.java:283) at org.eclipse.core.launcher.Main.run(Main.java:984) at org.eclipse.core.launcher.Main.main(Main.java:959) Caused by: java.lang.IndexOutOfBoundsException: Index: 3, Size: 3 at java.util.ArrayList.RangeCheck(ArrayList.java:547) at java.util.ArrayList.get(ArrayList.java:322) at org.eclipse.birt.report.designer.internal.ui.editors.parts.event.ModelEventManager.postModelEvent(ModelEventManager.java:125) ... 40 more
UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/internal/ui/editors/parts/event/ModelEventManager.java
/*******************************************************************************
 * Copyright (c) 2004 Actuate Corporation.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *  Actuate Corporation  - initial API and implementation
 *******************************************************************************/
package org.eclipse.birt.report.designer.internal.ui.editors.parts.event;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.birt.report.designer.internal.ui.command.WrapperCommandStack;
import org.eclipse.birt.report.designer.internal.ui.util.ExceptionHandler;
import org.eclipse.birt.report.designer.internal.ui.views.outline.ListenerElementVisitor;
import org.eclipse.birt.report.model.api.DesignElementHandle;
import org.eclipse.birt.report.model.api.activity.ActivityStackEvent;
import org.eclipse.birt.report.model.api.activity.ActivityStackListener;
import org.eclipse.birt.report.model.api.activity.NotificationEvent;
import org.eclipse.birt.report.model.api.core.Listener;
/**
 * To manager the all model evetn, It is a facade for the model event and the model listener.
 * It is listener to the model then pass this event to the processor.
 * And through the command stack to listener the model trans if commit or roll back.
 */
 
public class ModelEventManager implements Listener