if (this.baseItemLabelGenerator != null) { if (this.baseItemLabelGenerator instanceof PublicCloneable) { PublicCloneable pc = (PublicCloneable) this.baseItemLabelGenerator; clone.baseItemLabelGenerator = (CategoryItemLabelGenerator) pc.clone(); } else { throw new CloneNotSupportedException( "ItemLabelGenerator not cloneable."); } }
if (this.baseToolTipGenerator != null) { if (this.baseToolTipGenerator instanceof PublicCloneable) { PublicCloneable pc = (PublicCloneable) this.baseToolTipGenerator; clone.baseToolTipGenerator = (CategoryToolTipGenerator) pc.clone(); } else { throw new CloneNotSupportedException( "Base tool tip 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.baseItemLabelGenerator != null) {
1
if (this.baseToolTipGenerator != null) {
2
            if (this.baseItemLabelGenerator instanceof PublicCloneable) {
2
            if (this.baseToolTipGenerator instanceof PublicCloneable) {
3
                PublicCloneable pc
3
                PublicCloneable pc
4
                        = (PublicCloneable) this.baseItemLabelGenerator;
4
                        = (PublicCloneable) this.baseToolTipGenerator;
5
                clone.baseItemLabelGenerator
5
                clone.baseToolTipGenerator
6
                        = (CategoryItemLabelGenerator) pc.clone();
6
                        = (CategoryToolTipGenerator) pc.clone();
7
            }
7
            }
8
            else {
8
            else {
9
                throw new CloneNotSupportedException(
9
                throw new CloneNotSupportedException(
10
                        "ItemLabelGenerator not cloneable.");
10
                        "Base tool tip generator not cloneable.");
11
            }
11
            }
12
        }
12
        }
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.1
Clones locationClones are in the same method
Number of node comparisons1