From: SourceForge.net <no...@so...> - 2011-11-01 19:39:46
|
Bugs item #3432020, was opened at 2011-11-01 19:39 Message generated for change (Tracker Item Submitted) made by You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=115494&aid=3432020&group_id=15494 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: https://www.google.com/accounts () Assigned to: Nobody/Anonymous (nobody) Summary: AbstractXYItemRenderer.clone() bug? in 1.0.13 Initial Comment: I was debugging a dataset clone operation and when it got into cloning the renderer I noticed some unusual code. It looks like a bug to me. I will add some comments to the code to hopefully point it out. This is from AbstractXYItemRenderer.clone(): <code> // should be referring to "this" not to "clone"? If this.field is cloneable then clone it. // three if statements if (clone.legendItemLabelGenerator instanceof PublicCloneable) { clone.legendItemLabelGenerator = (XYSeriesLabelGenerator) ObjectUtilities .clone(this .legendItemLabelGenerator); } if (clone.legendItemToolTipGenerator instanceof PublicCloneable) { clone.legendItemToolTipGenerator = (XYSeriesLabelGenerator) ObjectUtilities .clone(this .legendItemToolTipGenerator); } if (clone.legendItemURLGenerator instanceof PublicCloneable) { clone.legendItemURLGenerator = (XYSeriesLabelGenerator) ObjectUtilities .clone(this .legendItemURLGenerator); } // skip these - only present so you have context of where we are in code clone.foregroundAnnotations = (List) ObjectUtilities .deepClone(this .foregroundAnnotations); clone.backgroundAnnotations = (List) ObjectUtilities .deepClone(this .backgroundAnnotations); // second occurrence of the same code - this is both wrong and redundant? if (clone.legendItemLabelGenerator instanceof PublicCloneable) { clone.legendItemLabelGenerator = (XYSeriesLabelGenerator) ObjectUtilities .clone(this .legendItemLabelGenerator); } if (clone.legendItemToolTipGenerator instanceof PublicCloneable) { clone.legendItemToolTipGenerator = (XYSeriesLabelGenerator) ObjectUtilities .clone(this .legendItemToolTipGenerator); } if (clone.legendItemURLGenerator instanceof PublicCloneable) { clone.legendItemURLGenerator = (XYSeriesLabelGenerator) ObjectUtilities .clone(this .legendItemURLGenerator); } </code> ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=115494&aid=3432020&group_id=15494 |