File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/category/AbstractCategoryItemRenderer.java | File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/category/AbstractCategoryItemRenderer.java | |||
Method name: Object clone()
|
Method name: Object clone()
|
|||
Number of AST nodes: 5 | Number of AST nodes: 5 | |||
1 | if (this.itemLabelGenerator != null) {↵ | 1 | if (this.baseItemLabelGenerator != null) {↵ | |
2 | if (this.itemLabelGenerator instanceof PublicCloneable) {↵ | 2 | if (this.baseItemLabelGenerator instanceof PublicCloneable) {↵ | |
3 | PublicCloneable pc↵ | 3 | PublicCloneable pc↵ | |
4 | = (PublicCloneable) this.itemLabelGenerator;↵ | 4 | = (PublicCloneable) this.baseItemLabelGenerator;↵ | |
5 | clone.itemLabelGenerator↵ | 5 | clone.baseItemLabelGenerator↵ | |
6 | = (CategoryItemLabelGenerator) pc.clone();↵ | 6 | = (CategoryItemLabelGenerator) pc.clone();↵ | |
7 | }↵ | 7 | }↵ | |
8 | else {↵ | 8 | else {↵ | |
9 | throw new CloneNotSupportedException(↵ | 9 | throw new CloneNotSupportedException(↵ | |
10 | "ItemLabelGenerator not cloneable.");↵ | 10 | "ItemLabelGenerator not cloneable.");↵ | |
11 | }↵ | 11 | }↵ | |
12 | } | 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.4 |
Clones location | Clones are in the same method |
Number of node comparisons | 17 |
Number of mapped statements | 5 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 2.3 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2 | if (this.itemLabelGenerator != null) |
| 9 | if (this.baseItemLabelGenerator != null) | ||||||||||||
3 | if (this.itemLabelGenerator instanceof PublicCloneable) |
| 10 | if (this.baseItemLabelGenerator instanceof PublicCloneable) | ||||||||||||
4 | PublicCloneable pc = (PublicCloneable)this.itemLabelGenerator; |
| 11 | PublicCloneable pc = (PublicCloneable)this.baseItemLabelGenerator; | ||||||||||||
5 | clone.itemLabelGenerator = (CategoryItemLabelGenerator)pc.clone(); |
| 12 | clone.baseItemLabelGenerator = (CategoryItemLabelGenerator)pc.clone(); | ||||||||||||
else | else | |||||||||||||||
6 | throw new CloneNotSupportedException("ItemLabelGenerator not cloneable."); | 13 | throw new CloneNotSupportedException("ItemLabelGenerator not cloneable."); |
Row | Violation |
---|---|
1 | Expression clone.itemLabelGenerator is a field being modified, and thus it cannot be parameterized |
2 | Expression clone.baseItemLabelGenerator is a field being modified, and thus it cannot be parameterized |