if (this.toolTipGenerator != null) { if (this.toolTipGenerator instanceof PublicCloneable) { PublicCloneable pc = (PublicCloneable) this.toolTipGenerator; clone.toolTipGenerator = (CategoryToolTipGenerator) pc.clone(); } else { throw new CloneNotSupportedException( "Tool tip generator 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.toolTipGenerator != null) {
1
if (this.baseToolTipGenerator != null) {
2
            if (this.toolTipGenerator instanceof PublicCloneable) {
2
            if (this.baseToolTipGenerator instanceof PublicCloneable) {
3
                PublicCloneable pc
3
                PublicCloneable pc
4
 = (PublicCloneable) this.toolTipGenerator;
4
                        = (PublicCloneable) this.baseToolTipGenerator;
5
                clone.toolTipGenerator
5
                clone.baseToolTipGenerator
6
 = (CategoryToolTipGenerator) pc.clone();
6
                        = (CategoryToolTipGenerator) pc.clone();
7
            }
7
            }
8
            else {
8
            else {
9
                throw new CloneNotSupportedException(
9
                throw new CloneNotSupportedException(
10
                        "Tool tip generator not cloneable.");
10
                        "Base tool tip generator not cloneable.");
11
            }
11
            }
12
        }
12
        }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.2
Clones locationClones are in the same method
Number of node comparisons17
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)2.3
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    14
    if (this.toolTipGenerator != null)
    14
    if (this.toolTipGenerator != null)
    21
    if (this.baseToolTipGenerator != null)
    Differences
    Expression1Expression2Difference
    toolTipGeneratorbaseToolTipGeneratorVARIABLE_NAME_MISMATCH
    21
    if (this.baseToolTipGenerator != null)
    15
    if (this.toolTipGenerator instanceof PublicCloneable)
    15
    if (this.toolTipGenerator instanceof PublicCloneable)
    22
    if (this.baseToolTipGenerator instanceof PublicCloneable)
    Differences
    Expression1Expression2Difference
    toolTipGeneratorbaseToolTipGeneratorVARIABLE_NAME_MISMATCH
    22
    if (this.baseToolTipGenerator instanceof PublicCloneable)
    16
    PublicCloneable pc = (PublicCloneable)this.toolTipGenerator;
    16
    PublicCloneable pc = (PublicCloneable)this.toolTipGenerator;
    23
    PublicCloneable pc = (PublicCloneable)this.baseToolTipGenerator;
    Differences
    Expression1Expression2Difference
    toolTipGeneratorbaseToolTipGeneratorVARIABLE_NAME_MISMATCH
    23
    PublicCloneable pc = (PublicCloneable)this.baseToolTipGenerator;
    17
    clone.toolTipGenerator = (CategoryToolTipGenerator)pc.clone();
    17
    clone.toolTipGenerator = (CategoryToolTipGenerator)pc.clone();
    24
    clone.baseToolTipGenerator = (CategoryToolTipGenerator)pc.clone();
    Differences
    Expression1Expression2Difference
    toolTipGeneratorbaseToolTipGeneratorVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression clone.toolTipGenerator is a field being modified, and thus it cannot be parameterized
    Expression clone.baseToolTipGenerator is a field being modified, and thus it cannot be parameterized
    24
    clone.baseToolTipGenerator = (CategoryToolTipGenerator)pc.clone();
    else
    else
    18
    throw new CloneNotSupportedException("Tool tip generator not cloneable.");
    18
    throw new CloneNotSupportedException("Tool tip generator not cloneable.");
    25
    throw new CloneNotSupportedException("Base tool tip generator not cloneable.");
    Differences
    Expression1Expression2Difference
    "Tool tip generator not cloneable.""Base tool tip generator not cloneable."LITERAL_VALUE_MISMATCH
    25
    throw new CloneNotSupportedException("Base tool tip generator not cloneable.");
    Precondition Violations (2)
    Row Violation
    1Expression clone.toolTipGenerator is a field being modified, and thus it cannot be parameterized
    2Expression clone.baseToolTipGenerator is a field being modified, and thus it cannot be parameterized