Project: Birt
Bug 217546 NPE throws out when drag a chart into a crosstab measure cell which is not blank[1301]
Reported: 2008-02-02 04:14:30 | Status: closed fixed

Description: There is a crosstab with measures defined, drag a chart into the measure cell, not define any series data, NPE throws out. Build verison:2.3.0.v20080202-0800 Steps to reproduce: 1.There is a crosstab in the layout, which has a measure defined in it. 2.Drag a chart from palette to the measure cell of crosstab, not define any data. NPE throw out. Expected result: If chart is not allowed to drag into a non-blank measure cell, the operation shall be forbidden. Error: java.lang.RuntimeException: java.lang.NullPointerException at org.eclipse.birt.chart.reportitem.ui.ChartReportItemBuilderImpl.open(ChartReportItemBuilderImpl.java:269) at org.eclipse.birt.report.designer.internal.ui.editors.schematic.extensions.ExtendedElementToolExtends.postHandleCreation(ExtendedElementToolExtends.java:51) at org.eclipse.birt.report.designer.internal.ui.palette.ReportTemplateTransferDropTargetListener.handleDrop(ReportTemplateTransferDropTargetListener.java:269) at org.eclipse.gef.dnd.AbstractTransferDropTargetListener.drop(AbstractTransferDropTargetListener.java:171) at org.eclipse.jface.util.DelegatingDropAdapter$3.run(DelegatingDropAdapter.java:211) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37) at org.eclipse.core.runtime.Platform.run(Platform.java:857) at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:46) at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:199) at org.eclipse.jface.util.DelegatingDropAdapter.drop(DelegatingDropAdapter.java:209) at org.eclipse.swt.dnd.DNDListener.handleEvent(DNDListener.java:90) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:952) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:976) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:961) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:720) at org.eclipse.swt.dnd.DropTarget.Drop(DropTarget.java:451) at org.eclipse.swt.dnd.DropTarget$3.method6(DropTarget.java:253) at org.eclipse.swt.internal.ole.win32.COMObject.callback6(COMObject.java:119) at org.eclipse.swt.internal.ole.win32.COM.DoDragDrop(Native Method) at org.eclipse.swt.dnd.DragSource.drag(DragSource.java:358) at org.eclipse.swt.dnd.DragSource.access$0(DragSource.java:284) at org.eclipse.swt.dnd.DragSource$1.handleEvent(DragSource.java:168) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:952) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3750) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3361) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2381) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2345) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2211) at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:473) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:288) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:468) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:106) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:193) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:106) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:76) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:362) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:175) 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:561) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:501) at org.eclipse.equinox.launcher.Main.run(Main.java:1239) Caused by: java.lang.NullPointerException at org.eclipse.birt.chart.reportitem.ui.ChartXTabUIUtil.updateXTabForAxis(ChartXTabUIUtil.java:201) at org.eclipse.birt.chart.reportitem.ui.ChartReportItemBuilderImpl.open(ChartReportItemBuilderImpl.java:237) ... 46 more

Files changed in fix:
chart/org.eclipse.birt.chart.reportitem.ui/src/org/eclipse/birt/chart/reportitem/ui/ChartXTabUIUtil.java