From: David G. <mu...@us...> - 2006-09-07 15:26:54
|
Update of /cvsroot/jfreechart/jfreechart/source/org/jfree/data/statistics In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv22993/source/org/jfree/data/statistics Modified Files: Tag: STABLE_1-0-0 HistogramDataset.java Log Message: 2006-09-07 David Gilbert <dav...@ob...> * source/org/jfree/data/statistics/HistogramDataset.java (addSeries): Check for binIndex that is too large, * source/org/jfree/data/statistics/junit/HistogramDatasetTests.java (test1553088): New method. Index: HistogramDataset.java =================================================================== RCS file: /cvsroot/jfreechart/jfreechart/source/org/jfree/data/statistics/HistogramDataset.java,v retrieving revision 1.9.2.6 retrieving revision 1.9.2.7 diff -C2 -d -r1.9.2.6 -r1.9.2.7 *** HistogramDataset.java 3 Aug 2006 10:37:53 -0000 1.9.2.6 --- HistogramDataset.java 7 Sep 2006 15:26:49 -0000 1.9.2.7 *************** *** 54,57 **** --- 54,58 ---- * ------------- JFREECHART 1.0.0 --------------------------------------------- * 03-Aug-2006 : Improved precision of bin boundary calculation (DG); + * 07-Sep-2006 : Fixed bug 1553088 (DG); * */ *************** *** 193,196 **** --- 194,203 ---- } binIndex = (int) (fraction * bins); + // rounding could result in binIndex being equal to bins + // which will cause an IndexOutOfBoundsException - see bug + // report 1553088 + if (binIndex >= bins) { + binIndex = bins - 1; + } } HistogramBin bin = (HistogramBin) binList.get(binIndex); |