JFreeChart 1.0.12 - Regression bug?

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
krheinwald
Posts: 15
Joined: Thu Mar 27, 2003 10:06 am

JFreeChart 1.0.12 - Regression bug?

Post by krheinwald » Tue Feb 03, 2009 2:29 pm

David,

I ran into a problem when I upgraded from 1.0.11 to 1.0.12. This line

((CategoryPlot) barChart.getPlot()).setRenderer(stackedBarRenderer, true);

which ran fine until and including 1.0.11 now throws the Exception below.

Any suggestion where to start looking?

Klaus

---

java.lang.IllegalArgumentException: Null 'dataset' argument.
at org.jfree.data.general.DatasetUtilities.findStackedRangeBounds(Unknown Source)
at org.jfree.data.general.DatasetUtilities.findStackedRangeBounds(Unknown Source)
at org.jfree.chart.renderer.category.StackedBarRenderer3D.findRangeBounds(Unknown Source)
at org.jfree.chart.plot.CategoryPlot.getDataRange(Unknown Source)
at org.jfree.chart.axis.NumberAxis.autoAdjustRange(Unknown Source)
at org.jfree.chart.axis.NumberAxis.configure(Unknown Source)
at org.jfree.chart.plot.CategoryPlot.configureRangeAxes(Unknown Source)
at org.jfree.chart.plot.CategoryPlot.setRenderer(Unknown Source)
at org.jfree.chart.plot.CategoryPlot.setRenderer(Unknown Source)
at paralog.Charts.updateBarChart(Charts.java:190)
at paralog.Charts.update(Charts.java:729)
at paralog.ChartDialog.<init>(ChartDialog.java:31)

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Tue Feb 03, 2009 5:49 pm

Thanks for the report. I just committed a fix to Subversion for inclusion in the 1.0.13 release (the findRangeBounds() method is missing a null dataset check --- see the same method in StackedBarRenderer and note the difference).
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

krheinwald
Posts: 15
Joined: Thu Mar 27, 2003 10:06 am

Post by krheinwald » Tue Feb 03, 2009 6:39 pm

Thanks David,

I will fix it locally.

Klaus

krheinwald
Posts: 15
Joined: Thu Mar 27, 2003 10:06 am

Post by krheinwald » Wed Feb 04, 2009 12:23 pm

hansk, David!

That fixed it. There are still a lot of those

Code: Select all

throw new IllegalArgumentException("Null ')
in this module, though.

Klaus

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Wed Feb 04, 2009 1:35 pm

Most of the time I write methods that won't accept null arguments, unless there is a good reason for it. So all over JFreeChart you'll see these null argument checks. But in the findRangeBounds() methods I permitted a null argument in the API, and even though I'd probably not do that now it is too late to change it.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

Locked