File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/XYBlockRenderer.java | File path: /jfreechart-1.0.10/src/org/jfree/data/xy/XYBarDataset.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 | XYBarDataset clone = (XYBarDataset) 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 = (XYDataset) 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.3 |
Clones location | Clones are in different classes |
Number of node comparisons | 13 |
Number of mapped statements | 4 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 4.2 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | XYBlockRenderer clone = (XYBlockRenderer)super.clone(); |
| 1 | XYBarDataset clone = (XYBarDataset)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 = (XYDataset)pc.clone(); | |||||||||||||||||||
4 | clone.paintScale = (PaintScale)pc.clone(); |
| | |||||||||||||||||||
5 | return clone; |
| 5 | return clone; |
Row | Violation |
---|---|
1 | Super method call XYBlockRenderer clone=(XYBlockRenderer)super.clone(); cannot be extracted from method |
2 | Super method call XYBarDataset clone=(XYBarDataset)super.clone(); cannot be extracted from method |
3 | Type org.jfree.chart.renderer.PaintScale of variable this.paintScale does not match with type org.jfree.data.xy.XYDataset of variable this.underlying |
4 | Type org.jfree.chart.renderer.PaintScale of variable this.paintScale does not match with type org.jfree.data.xy.XYDataset of variable this.underlying |
5 | Unmatched statement clone.underlying=(XYDataset)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.underlying=(XYDataset)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 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 |
8 | 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 |
9 | Clone fragment #1 returns variables clone, pc , while Clone fragment #2 returns variables clone, pc |