Project: Birt
Bug 278999 NPE in BaseRenderer.renderLabel
Reported: 2009-06-03 14:39:16 | Status: verified fixed

Hi there, I am trying to add a label to the plot (this used to work with chart engine 2.3): cwoaPie.getPlot().add(label); However, when rendering this, the exception below occurs. To re-create the bug: * apply the attached patch to the org.eclipse.birt.chart.examples * from the ChartView, pick "Primitive Charts" -> "Pie" I searched for an existing bug, but couldn't find one. I apologize if this is a duplicate. --- exception trace --- org.eclipse.birt.chart.exception.ChartException at org.eclipse.birt.chart.factory.Generator.render(Generator.java:1272) at org.eclipse.birt.chart.examples.view.util.ChartPreview.updateBuffer(ChartPreview.java:157) at org.eclipse.birt.chart.examples.view.util.ChartPreview.renderModel(ChartPreview.java:67) at org.eclipse.birt.chart.examples.view.ChartExamples.widgetSelected(ChartExamples.java:233) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:228) 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) at org.eclipse.equinox.launcher.Main.main(Main.java:1287) Caused by: java.lang.NullPointerException at org.eclipse.birt.chart.render.BaseRenderer.renderLabel(BaseRenderer.java:1764) at org.eclipse.birt.chart.render.BaseRenderer.renderTitle(BaseRenderer.java:1809) at org.eclipse.birt.chart.render.BaseRenderer.render(BaseRenderer.java:475) at org.eclipse.birt.chart.factory.Generator.render(Generator.java:1267) ... 29 more

Files changed in fix:
chart/org.eclipse.birt.chart.engine/src/org/eclipse/birt/chart/render/BaseRenderer.java