File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/XYBlockRenderer.java | File path: /jfreechart-1.0.10/src/org/jfree/data/category/SlidingCategoryDataset.java | |||
Method name: Object clone()
|
Method name: Object clone()
|
|||
Number of AST nodes: 5 | Number of AST nodes: 5 | |||
1 | XYBlockRenderer clone = (XYBlockRenderer) super.clone();↵ | 1 | SlidingCategoryDataset clone = (SlidingCategoryDataset) super.clone();↵ | |
2 | if (this.paintScale instanceof PublicCloneable) {↵ | 2 | if (this.underlying instanceof PublicCloneable) {↵ | |
3 | PublicCloneable pc = (PublicCloneable) this.paintScale;↵ | 3 | PublicCloneable pc = (PublicCloneable) this.underlying;↵ | |
4 | clone.paintScale = (PaintScale) pc.clone();↵ | 4 | clone.underlying = (CategoryDataset) pc.clone();↵ | |
5 | }↵ | 5 | }↵ | |
6 | return clone; | 6 |
| |
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.2 |
Clones location | Clones are in different classes |
Number of node comparisons | 13 |
Number of mapped statements | 2 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 3 |
Time elapsed for statement mapping (ms) | 1.7 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | SlidingCategoryDataset clone = (SlidingCategoryDataset)super.clone(); | ||||||||||||||||
1 | XYBlockRenderer clone = (XYBlockRenderer)super.clone(); | | ||||||||||||||||
2 | if (this.paintScale instanceof PublicCloneable) |
| 2 | if (this.underlying instanceof PublicCloneable) | ||||||||||||||
3 | PublicCloneable pc = (PublicCloneable)this.paintScale; |
| 3 | PublicCloneable pc = (PublicCloneable)this.underlying; | ||||||||||||||
|
| 4 | clone.underlying = (CategoryDataset)pc.clone(); | |||||||||||||||
4 | clone.paintScale = (PaintScale)pc.clone(); |
| | |||||||||||||||
|
| 5 | return clone; | |||||||||||||||
5 | return clone; |
| |
Row | Violation |
---|---|
1 | Type org.jfree.chart.renderer.PaintScale of variable this.paintScale does not match with type org.jfree.data.category.CategoryDataset of variable this.underlying |
2 | Type org.jfree.chart.renderer.PaintScale of variable this.paintScale does not match with type org.jfree.data.category.CategoryDataset of variable this.underlying |
3 | Unmatched statement clone.underlying=(CategoryDataset)pc.clone(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Unmatched statement clone.underlying=(CategoryDataset)pc.clone(); 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 |
5 | Unmatched statement clone.paintScale=(PaintScale)pc.clone(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
6 | Unmatched statement clone.paintScale=(PaintScale)pc.clone(); 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 |
7 | Unmatched return clone; |
8 | Unmatched return clone; |