1139-1-5

if (this.itemLabelGenerator != null) { if (this.itemLabelGenerator instanceof PublicCloneable) { PublicCloneable pc = (PublicCloneable) this.itemLabelGenerator; clone.itemLabelGenerator = (CategoryItemLabelGenerator) pc.clone(); } else { throw new CloneNotSupportedException( "ItemLabelGenerator not cloneable."); } }
if (this.itemURLGenerator != null) { if (this.itemURLGenerator instanceof PublicCloneable) { PublicCloneable pc = (PublicCloneable) this.itemURLGenerator; clone.itemURLGenerator = (CategoryURLGenerator) pc.clone(); } else { throw new CloneNotSupportedException( "Item URL generator not cloneable."); } }

Clone fragments detected by clone detection tool
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.itemURLGenerator != null) {↵

2

                if (this.itemLabelGenerator instanceof PublicCloneable) {↵

2

                if (this.itemURLGenerator instanceof PublicCloneable) {↵

3

                    PublicCloneable pc = (PublicCloneable) this.itemLabelGenerator;↵

3

                    PublicCloneable pc = (PublicCloneable) this.itemURLGenerator;↵

4

                    clone.itemLabelGenerator↵

4

                    clone.itemURLGenerator↵

5

                            = (CategoryItemLabelGenerator) pc.clone();↵

5

     = (CategoryURLGenerator) pc.clone();↵

6

                }↵

6

                }↵

7

                else {↵

7

                else {↵

8

                    throw new CloneNotSupportedException(↵

8

                    throw new CloneNotSupportedException(↵

9

                            "ItemLabelGenerator not cloneable.");↵

9

                            "Item URL generator not cloneable.");↵

10

                }↵

10

                }↵

11

            }

11

            }

See real code fragment |  | See real code fragment

Summary
Number of common nesting structure subtrees | 0
Number of refactorable cases | 0
Number of non-refactorable cases | 0
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.1
Clones location | Clones are in the same method
Number of node comparisons | 1