AbstractCategoryItemLabelGenerator clone = (AbstractCategoryItemLabelGenerator) super.clone(); if (this.numberFormat != null) { clone.numberFormat = (NumberFormat) this.numberFormat.clone(); } if (this.dateFormat != null) { clone.dateFormat = (DateFormat) this.dateFormat.clone(); } return clone;
HighLowItemLabelGenerator clone = (HighLowItemLabelGenerator) super.clone(); if (this.dateFormatter != null) { clone.dateFormatter = (DateFormat) this.dateFormatter.clone(); } if (this.numberFormatter != null) { clone.numberFormatter = (NumberFormat) this.numberFormatter.clone(); } return clone;
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/labels/AbstractCategoryItemLabelGenerator.java File path: /jfreechart-1.0.10/src/org/jfree/chart/labels/HighLowItemLabelGenerator.java
Method name: Object clone() Method name: Object clone()
Number of AST nodes: 6 Number of AST nodes: 6
1
AbstractCategoryItemLabelGenerator clone 
1
HighLowItemLabelGenerator clone 
2
            = (AbstractCategoryItemLabelGenerator) super.clone();
2
            = (HighLowItemLabelGenerator) super.clone();
3
        if (this.numberFormat != null) {
3
        if (this.dateFormatter != null) {
4
            clone.numberFormat = (NumberFormat) this.numberFormat.clone();
4
            clone.dateFormatter = (DateFormat) this.dateFormatter.clone();
5
        } 
5
        }
6
        if (this.dateFormat != null) {
6
        if (this.numberFormatter != null) {
7
            clone.dateFormat = (DateFormat) this.dateFormat.clone();
7
            clone.numberFormatter = (NumberFormat) this.numberFormatter.clone();
8
        }
8
        }
9
 
9
        
10
        return clone;
10
        return clone;
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.5
Clones locationClones are in different classes
Number of node comparisons17
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements6
    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.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    AbstractCategoryItemLabelGenerator clone = (AbstractCategoryItemLabelGenerator)super.clone();
    1
    AbstractCategoryItemLabelGenerator clone = (AbstractCategoryItemLabelGenerator)super.clone();
    1
    HighLowItemLabelGenerator clone = (HighLowItemLabelGenerator)super.clone();
    Differences
    Expression1Expression2Difference
    org.jfree.chart.labels.AbstractCategoryItemLabelGeneratororg.jfree.chart.labels.HighLowItemLabelGeneratorSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.labels.AbstractCategoryItemLabelGeneratororg.jfree.chart.labels.HighLowItemLabelGeneratorSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.labels.AbstractCategoryItemLabelGeneratororg.jfree.chart.labels.HighLowItemLabelGeneratorSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Super method call AbstractCategoryItemLabelGenerator clone=(AbstractCategoryItemLabelGenerator)super.clone(); cannot be extracted from method
    Super method call HighLowItemLabelGenerator clone=(HighLowItemLabelGenerator)super.clone(); cannot be extracted from method
    1
    HighLowItemLabelGenerator clone = (HighLowItemLabelGenerator)super.clone();
    2
    if (this.numberFormat != null)
    2
    if (this.numberFormat != null)
    4
    if (this.numberFormatter != null)
    Differences
    Expression1Expression2Difference
    numberFormatnumberFormatterVARIABLE_NAME_MISMATCH
    4
    if (this.numberFormatter != null)
    3
    clone.numberFormat = (NumberFormat)this.numberFormat.clone();
    3
    clone.numberFormat = (NumberFormat)this.numberFormat.clone();
    5
    clone.numberFormatter = (NumberFormat)this.numberFormatter.clone();
    Differences
    Expression1Expression2Difference
    org.jfree.chart.labels.AbstractCategoryItemLabelGeneratororg.jfree.chart.labels.HighLowItemLabelGeneratorSUBCLASS_TYPE_MISMATCH
    numberFormatnumberFormatterVARIABLE_NAME_MISMATCH
    numberFormatnumberFormatterVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression clone.numberFormat cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression clone.numberFormatter cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression clone.numberFormat is a field being modified, and thus it cannot be parameterized
    Expression clone.numberFormatter is a field being modified, and thus it cannot be parameterized
    5
    clone.numberFormatter = (NumberFormat)this.numberFormatter.clone();
    4
    if (this.dateFormat != null)
    4
    if (this.dateFormat != null)
    2
    if (this.dateFormatter != null)
    Differences
    Expression1Expression2Difference
    dateFormatdateFormatterVARIABLE_NAME_MISMATCH
    2
    if (this.dateFormatter != null)
    5
    clone.dateFormat = (DateFormat)this.dateFormat.clone();
    5
    clone.dateFormat = (DateFormat)this.dateFormat.clone();
    3
    clone.dateFormatter = (DateFormat)this.dateFormatter.clone();
    Differences
    Expression1Expression2Difference
    org.jfree.chart.labels.AbstractCategoryItemLabelGeneratororg.jfree.chart.labels.HighLowItemLabelGeneratorSUBCLASS_TYPE_MISMATCH
    dateFormatdateFormatterVARIABLE_NAME_MISMATCH
    dateFormatdateFormatterVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression clone.dateFormat cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression clone.dateFormatter cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression clone.dateFormat is a field being modified, and thus it cannot be parameterized
    Expression clone.dateFormatter is a field being modified, and thus it cannot be parameterized
    3
    clone.dateFormatter = (DateFormat)this.dateFormatter.clone();
    6
    return clone;
    6
    return clone;
    6
    return clone;
    Differences
    Expression1Expression2Difference
    org.jfree.chart.labels.AbstractCategoryItemLabelGeneratororg.jfree.chart.labels.HighLowItemLabelGeneratorSUBCLASS_TYPE_MISMATCH
    6
    return clone;
    Precondition Violations (10)
    Row Violation
    1Super method call AbstractCategoryItemLabelGenerator clone=(AbstractCategoryItemLabelGenerator)super.clone(); cannot be extracted from method
    2Super method call HighLowItemLabelGenerator clone=(HighLowItemLabelGenerator)super.clone(); cannot be extracted from method
    3Expression clone.numberFormat cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression clone.numberFormatter cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression clone.numberFormat is a field being modified, and thus it cannot be parameterized
    6Expression clone.numberFormatter is a field being modified, and thus it cannot be parameterized
    7Expression clone.dateFormat cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression clone.dateFormatter cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression clone.dateFormat is a field being modified, and thus it cannot be parameterized
    10Expression clone.dateFormatter is a field being modified, and thus it cannot be parameterized