Project: Birt
Bug 280228 Exception is thrown out when double click Variable to insert page variavles
Reported: 2009-06-15 03:25:49 | Status: closed fixed

Description: Exception is thrown out when double click Variable to insert page variavles Build: Steps to reproduce: 1. New a report with page variable: a 2. Switch to Master Page and insert a grid into master page header 3. Select a grid cell and double click Variable to insert a page variable 4. Double click Variable again to insert a page variavle 5. After Insert variable dialog pops up, click cancel button 6. Colse the Error dialog and try to delete the grid Actual result: Step5, Error occured after click cancel button, and the first page variable inserted into grid cell disappeared. Step6, NPE thrown out after click delete option. Expect result: Two page variable can be inserted into the same grid cell successfully. Error log: org.eclipse.birt.report.designer.core.runtime.GUIException: Index: 1, Size: 0 at org.eclipse.birt.report.designer.core.runtime.GUIException.createGUIException(GUIException.java:78) at org.eclipse.birt.report.designer.internal.ui.util.ExceptionHandler.handle(ExceptionHandler.java:169) at org.eclipse.birt.report.designer.internal.ui.util.ExceptionHandler.handle(ExceptionHandler.java:150) at org.eclipse.birt.report.designer.internal.ui.util.ExceptionHandler.handle(ExceptionHandler.java:89) at org.eclipse.birt.report.designer.internal.ui.editors.parts.event.ModelEventManager.postModelEvent(ModelEventManager.java:128) at org.eclipse.birt.report.designer.internal.ui.editors.parts.event.ModelEventManager.postEvent(ModelEventManager.java:97) at org.eclipse.birt.report.designer.internal.ui.editors.parts.event.ModelEventManager.access$0(ModelEventManager.java:89) at org.eclipse.birt.report.designer.internal.ui.editors.parts.event.ModelEventManager$1.stackChanged(ModelEventManager.java:57) at org.eclipse.birt.report.model.activity.ActivityStack.sendNotifcations(ActivityStack.java:870) at org.eclipse.birt.report.model.activity.ActivityStack.commit(ActivityStack.java:740) at org.eclipse.birt.report.designer.internal.ui.editors.schematic.tools.ReportCreationTool.performCreation(ReportCreationTool.java:112) at org.eclipse.birt.report.designer.internal.ui.editors.schematic.tools.ReportCreationTool.performCreation(ReportCreationTool.java:149) at org.eclipse.birt.report.designer.internal.ui.editors.parts.GraphicalEditorWithFlyoutPalette$2$2.mouseDoubleClick(GraphicalEditorWithFlyoutPalette.java:262) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:183) 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:3880) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3473) 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) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194) 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:368) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) 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.launcher.Main.invokeFramework(Main.java:559) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514) at org.eclipse.equinox.launcher.Main.run(Main.java:1311) Caused by: java.lang.IndexOutOfBoundsException: Index: 1, Size: 0 at java.util.ArrayList.add(ArrayList.java:368) at org.eclipse.gef.editparts.AbstractEditPart.reorderChild(AbstractEditPart.java:887) at org.eclipse.gef.editparts.AbstractGraphicalEditPart.reorderChild(AbstractGraphicalEditPart.java:775) at org.eclipse.gef.editparts.AbstractEditPart.refreshChildren(AbstractEditPart.java:723) at org.eclipse.birt.report.designer.internal.ui.editors.schematic.editparts.ReportElementEditPart.refreshChildren(ReportElementEditPart.java:520) at org.eclipse.gef.editparts.AbstractEditPart.refresh(AbstractEditPart.java:677) at org.eclipse.gef.editparts.AbstractGraphicalEditPart.refresh(AbstractGraphicalEditPart.java:571) at org.eclipse.birt.report.designer.internal.ui.editors.schematic.editparts.ReportElementEditPart.contentChange(ReportElementEditPart.java:897) at org.eclipse.birt.report.designer.internal.ui.editors.schematic.editparts.AbstractReportEditPart.contentChange(AbstractReportEditPart.java:217) at org.eclipse.birt.report.designer.internal.ui.editors.schematic.editparts.AbstractReportEditPart$1.runModelChange(AbstractReportEditPart.java:77) at org.eclipse.birt.report.designer.internal.ui.editors.schematic.editparts.AbstractReportEditPart$EditpartReportEventRunnable.run(AbstractReportEditPart.java:249) at org.eclipse.birt.report.designer.internal.ui.editors.schematic.editparts.AbstractModelEventProcessor.postElementEvent(AbstractModelEventProcessor.java:95) at org.eclipse.birt.report.designer.internal.ui.editors.schematic.editparts.GraphicsViewModelEventProcessor.postElementEvent(GraphicsViewModelEventProcessor.java:216) at org.eclipse.birt.report.designer.internal.ui.editors.parts.event.ModelEventManager.postModelEvent(ModelEventManager.java:123) ... 33 more java.lang.NullPointerException at org.eclipse.birt.report.model.command.AbstractContentCommand.<init>(AbstractContentCommand.java:86) at org.eclipse.birt.report.model.command.ContentCommand.<init>(ContentCommand.java:130) at org.eclipse.birt.report.model.command.AbstractContentCommand.doDelectAction(AbstractContentCommand.java:388) at org.eclipse.birt.report.model.command.ContentCommand.doDelectAction(ContentCommand.java:946) at org.eclipse.birt.report.model.command.AbstractContentCommand.doRemove(AbstractContentCommand.java:346) at org.eclipse.birt.report.model.command.AbstractContentCommand.remove(AbstractContentCommand.java:303) at org.eclipse.birt.report.model.command.AbstractContentCommand.doDelectAction(AbstractContentCommand.java:395) at org.eclipse.birt.report.model.command.ContentCommand.doDelectAction(ContentCommand.java:946) at org.eclipse.birt.report.model.command.AbstractContentCommand.doRemove(AbstractContentCommand.java:346) at org.eclipse.birt.report.model.command.AbstractContentCommand.remove(AbstractContentCommand.java:303) at org.eclipse.birt.report.model.command.AbstractContentCommand.doDelectAction(AbstractContentCommand.java:395) at org.eclipse.birt.report.model.command.ContentCommand.doDelectAction(ContentCommand.java:946) at org.eclipse.birt.report.model.command.AbstractContentCommand.doRemove(AbstractContentCommand.java:346) at org.eclipse.birt.report.model.command.AbstractContentCommand.remove(AbstractContentCommand.java:303) at org.eclipse.birt.report.model.api.DesignElementHandle.dropAndClear(DesignElementHandle.java:1324) at org.eclipse.birt.report.designer.core.commands.DeleteCommand.dropSourceElementHandle(DeleteCommand.java:215) at org.eclipse.birt.report.designer.core.commands.DeleteCommand.dropSource(DeleteCommand.java:157) at org.eclipse.birt.report.designer.core.commands.DeleteCommand.dropSource(DeleteCommand.java:148) at org.eclipse.birt.report.designer.core.commands.DeleteCommand.execute(DeleteCommand.java:101) at org.eclipse.birt.report.designer.internal.ui.command.WrapperCommandStack.execute(WrapperCommandStack.java:92) at org.eclipse.gef.ui.actions.WorkbenchPartAction.execute(WorkbenchPartAction.java:76) at org.eclipse.gef.ui.actions.DeleteAction.run(DeleteAction.java:125) at org.eclipse.birt.report.designer.internal.ui.editors.parts.GraphicalEditorWithFlyoutPalette$3.run(GraphicalEditorWithFlyoutPalette.java:346) at org.eclipse.jface.action.Action.runWithEvent(Action.java:498) at org.eclipse.jface.commands.ActionHandler.execute(ActionHandler.java:119) at org.eclipse.core.commands.Command.executeWithChecks(Command.java:476) at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508) at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeCommand(WorkbenchKeyboard.java:470) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(WorkbenchKeyboard.java:824) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEvent(WorkbenchKeyboard.java:880) at org.eclipse.ui.internal.keys.OutOfOrderListener.handleEvent(OutOfOrderListener.java:76) 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.Widget.sendEvent(Widget.java:1027) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1012) at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1040) at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1036) at org.eclipse.swt.widgets.Widget.wmKeyDown(Widget.java:1669) at org.eclipse.swt.widgets.Control.WM_KEYDOWN(Control.java:4281) at org.eclipse.swt.widgets.Control.windowProc(Control.java:3977) at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:342) at org.eclipse.swt.widgets.Display.windowProc(Display.java:4602) at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method) at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2409) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3471) 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) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194) 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:368) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) 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.launcher.Main.invokeFramework(Main.java:559) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514) at org.eclipse.equinox.launcher.Main.run(Main.java:1311)

Files changed in fix:
UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/internal/ui/palette/BasePaletteFactory.java