From: <mu...@us...> - 2008-03-31 08:06:26
|
Revision: 791 http://jfreechart.svn.sourceforge.net/jfreechart/?rev=791&view=rev Author: mungady Date: 2008-03-31 01:06:22 -0700 (Mon, 31 Mar 2008) Log Message: ----------- 2008-03-31 David Gilbert <dav...@ob...> * source/org/jfree/chart/plot/CombinedDomainCategoryPlot.java (getSubplots): Return null if this.subplots is null, * source/org/jfree/chart/plot/CombinedDomainXYPlot.java: Likewise, * source/org/jfree/chart/plot/CombinedRangeCategoryPlot.java: Likewise, * source/org/jfree/chart/plot/CombinedRangeXYPlot.java: Likewise. Modified Paths: -------------- branches/jfreechart-1.0.x-branch/ChangeLog branches/jfreechart-1.0.x-branch/source/org/jfree/chart/plot/CombinedDomainCategoryPlot.java branches/jfreechart-1.0.x-branch/source/org/jfree/chart/plot/CombinedDomainXYPlot.java branches/jfreechart-1.0.x-branch/source/org/jfree/chart/plot/CombinedRangeCategoryPlot.java branches/jfreechart-1.0.x-branch/source/org/jfree/chart/plot/CombinedRangeXYPlot.java Modified: branches/jfreechart-1.0.x-branch/ChangeLog =================================================================== --- branches/jfreechart-1.0.x-branch/ChangeLog 2008-03-28 16:44:20 UTC (rev 790) +++ branches/jfreechart-1.0.x-branch/ChangeLog 2008-03-31 08:06:22 UTC (rev 791) @@ -1,3 +1,11 @@ +2008-03-31 David Gilbert <dav...@ob...> + + * source/org/jfree/chart/plot/CombinedDomainCategoryPlot.java + (getSubplots): Return null if this.subplots is null, + * source/org/jfree/chart/plot/CombinedDomainXYPlot.java: Likewise, + * source/org/jfree/chart/plot/CombinedRangeCategoryPlot.java: Likewise, + * source/org/jfree/chart/plot/CombinedRangeXYPlot.java: Likewise. + 2008-03-28 David Gilbert <dav...@ob...> * source/org/jfree/data/general/DatasetUtilities.java Modified: branches/jfreechart-1.0.x-branch/source/org/jfree/chart/plot/CombinedDomainCategoryPlot.java =================================================================== --- branches/jfreechart-1.0.x-branch/source/org/jfree/chart/plot/CombinedDomainCategoryPlot.java 2008-03-28 16:44:20 UTC (rev 790) +++ branches/jfreechart-1.0.x-branch/source/org/jfree/chart/plot/CombinedDomainCategoryPlot.java 2008-03-31 08:06:22 UTC (rev 791) @@ -54,6 +54,8 @@ * 17-Apr-2007 : Added null argument checks to findSubplot() (DG); * 14-Nov-2007 : Updated setFixedRangeAxisSpaceForSubplots() method (DG); * 27-Mar-2008 : Add documentation for getDataRange() method (DG); + * 31-Mar-2008 : Updated getSubplots() to return EMPTY_LIST for null + * subplots, as suggested by Richard West (DG); * */ @@ -221,12 +223,18 @@ } /** - * Returns the list of subplots. + * Returns the list of subplots. The returned list may be empty, but is + * never <code>null</code>. * - * @return An unmodifiable list of subplots . + * @return An unmodifiable list of subplots. */ public List getSubplots() { - return Collections.unmodifiableList(this.subplots); + if (this.subplots != null) { + return Collections.unmodifiableList(this.subplots); + } + else { + return Collections.EMPTY_LIST; + } } /** Modified: branches/jfreechart-1.0.x-branch/source/org/jfree/chart/plot/CombinedDomainXYPlot.java =================================================================== --- branches/jfreechart-1.0.x-branch/source/org/jfree/chart/plot/CombinedDomainXYPlot.java 2008-03-28 16:44:20 UTC (rev 790) +++ branches/jfreechart-1.0.x-branch/source/org/jfree/chart/plot/CombinedDomainXYPlot.java 2008-03-31 08:06:22 UTC (rev 791) @@ -86,6 +86,8 @@ * 28-Jan-2008 : Reset fixed range axis space in subplots for each call to * draw() (DG); * 27-Mar-2008 : Add documentation for getDataRange() method (DG); + * 31-Mar-2008 : Updated getSubplots() to return EMPTY_LIST for null + * subplots, as suggested by Richard West (DG); * */ @@ -319,12 +321,18 @@ } /** - * Returns the list of subplots. + * Returns the list of subplots. The returned list may be empty, but is + * never <code>null</code>. * * @return An unmodifiable list of subplots. */ public List getSubplots() { - return Collections.unmodifiableList(this.subplots); + if (this.subplots != null) { + return Collections.unmodifiableList(this.subplots); + } + else { + return Collections.EMPTY_LIST; + } } /** Modified: branches/jfreechart-1.0.x-branch/source/org/jfree/chart/plot/CombinedRangeCategoryPlot.java =================================================================== --- branches/jfreechart-1.0.x-branch/source/org/jfree/chart/plot/CombinedRangeCategoryPlot.java 2008-03-28 16:44:20 UTC (rev 790) +++ branches/jfreechart-1.0.x-branch/source/org/jfree/chart/plot/CombinedRangeCategoryPlot.java 2008-03-31 08:06:22 UTC (rev 791) @@ -51,6 +51,8 @@ * 05-May-2005 : Updated draw() method parameters (DG); * 14-Nov-2007 : Updated setFixedDomainAxisSpaceForSubplots() method (DG); * 27-Mar-2008 : Add documentation for getDataRange() method (DG); + * 31-Mar-2008 : Updated getSubplots() to return EMPTY_LIST for null + * subplots, as suggested by Richard West (DG); * */ @@ -224,12 +226,18 @@ } /** - * Returns the list of subplots. + * Returns the list of subplots. The returned list may be empty, but is + * never <code>null</code>. * - * @return The list (unmodifiable). + * @return An unmodifiable list of subplots. */ public List getSubplots() { - return Collections.unmodifiableList(this.subplots); + if (this.subplots != null) { + return Collections.unmodifiableList(this.subplots); + } + else { + return Collections.EMPTY_LIST; + } } /** Modified: branches/jfreechart-1.0.x-branch/source/org/jfree/chart/plot/CombinedRangeXYPlot.java =================================================================== --- branches/jfreechart-1.0.x-branch/source/org/jfree/chart/plot/CombinedRangeXYPlot.java 2008-03-28 16:44:20 UTC (rev 790) +++ branches/jfreechart-1.0.x-branch/source/org/jfree/chart/plot/CombinedRangeXYPlot.java 2008-03-31 08:06:22 UTC (rev 791) @@ -88,6 +88,8 @@ * 27-Nov-2007 : Modified setFixedDomainAxisSpaceForSubplots() so as not to * trigger change events in subplots (DG); * 27-Mar-2008 : Add documentation for getDataRange() method (DG); + * 31-Mar-2008 : Updated getSubplots() to return EMPTY_LIST for null + * subplots, as suggested by Richard West (DG); * */ @@ -260,12 +262,18 @@ } /** - * Returns a list of the subplots. + * Returns the list of subplots. The returned list may be empty, but is + * never <code>null</code>. * - * @return The list (unmodifiable). + * @return An unmodifiable list of subplots. */ public List getSubplots() { - return Collections.unmodifiableList(this.subplots); + if (this.subplots != null) { + return Collections.unmodifiableList(this.subplots); + } + else { + return Collections.EMPTY_LIST; + } } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |