File path: /jfreechart-1.0.10/src/org/jfree/chart/ChartRenderingInfo.java | File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/Plot.java | |||
Method name: Object clone()
|
Method name: Object clone()
|
|||
Number of AST nodes: 7 | Number of AST nodes: 6 | |||
1 | ChartRenderingInfo clone = (ChartRenderingInfo) super.clone();↵ | 1 | Plot clone = (Plot) super.clone();↵ | |
2 | // private Plot parent <-- don't clone the parent plot, but take care↵ | |||
3 | // childs in combined plots instead↵ | |||
2 | if (this.chartArea != null) {↵ | 4 | if (this.datasetGroup != null) {↵ | |
3 | clone.chartArea = (Rectangle2D) this.chartArea.clone();↵ | 5 | clone.↵ | |
4 | }↵ | |||
5 | if (this.entities instanceof PublicCloneable) {↵ | |||
6 | PublicCloneable pc = (PublicCloneable) this.entities;↵ | |||
7 | clone.entities = (EntityCollection) pc.clone();↵ | |||
8 | }↵ | 6 | datasetGroup↵ | |
7 | = (DatasetGroup) ObjectUtilities.clone(this.datasetGroup);↵ | |||
8 | }↵ | |||
9 | clone.drawingSupplier↵ | |||
10 | = (DrawingSupplier) ObjectUtilities.clone(this.drawingSupplier);↵ | |||
11 | clone.listenerList = new EventListenerList();↵ | |||
9 | return clone; | 12 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.5 |
Clones location | Clones are in different classes |
Number of node comparisons | 13 |
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 5 |
Time elapsed for statement mapping (ms) | 1.4 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | Plot clone = (Plot)super.clone(); | ||||||||||||||||
1 | ChartRenderingInfo clone = (ChartRenderingInfo)super.clone(); | | ||||||||||||||||
2 | if (this.chartArea != null) |
| 2 | if (this.datasetGroup != null) | ||||||||||||||
|
| 3 | clone.datasetGroup = (DatasetGroup)ObjectUtilities.clone(this.datasetGroup); | |||||||||||||||
3 | clone.chartArea = (Rectangle2D)this.chartArea.clone(); |
| | |||||||||||||||
|
| 4 | clone.drawingSupplier = (DrawingSupplier)ObjectUtilities.clone(this.drawingSupplier); | |||||||||||||||
|
| 5 | clone.listenerList = new EventListenerList(); | |||||||||||||||
|
| 6 | return clone; | |||||||||||||||
7 | return clone; |
| |
Row | Violation |
---|---|
1 | Type java.awt.geom.Rectangle2D of variable this.chartArea does not match with type org.jfree.data.general.DatasetGroup of variable this.datasetGroup |
2 | Unmatched statement clone.datasetGroup=(DatasetGroup)ObjectUtilities.clone(this.datasetGroup); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
3 | Unmatched statement clone.datasetGroup=(DatasetGroup)ObjectUtilities.clone(this.datasetGroup); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted |
4 | Unmatched statement clone.chartArea=(Rectangle2D)this.chartArea.clone(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
5 | Unmatched statement clone.drawingSupplier=(DrawingSupplier)ObjectUtilities.clone(this.drawingSupplier); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
6 | Unmatched statement clone.listenerList=new EventListenerList(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
7 | Unmatched return clone; |
8 | Unmatched return clone; |
9 | The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero |