CombinedRangeCategoryPlot result = (CombinedRangeCategoryPlot) super.clone(); result.subplots = (List) ObjectUtilities.deepClone(this.subplots); for (Iterator it = result.subplots.iterator(); it.hasNext();) { Plot child = (Plot) it.next(); child.setParent(result); } // after setting up all the subplots, the shared range axis may need // reconfiguring ValueAxis rangeAxis = result.getRangeAxis(); if (rangeAxis != null) { rangeAxis.configure(); } return result;
CombinedRangeXYPlot result = (CombinedRangeXYPlot) super.clone(); result.subplots = (List) ObjectUtilities.deepClone(this.subplots); for (Iterator it = result.subplots.iterator(); it.hasNext();) { Plot child = (Plot) it.next(); child.setParent(result); } // after setting up all the subplots, the shared range axis may need // reconfiguring ValueAxis rangeAxis = result.getRangeAxis(); if (rangeAxis != null) { rangeAxis.configure(); } return result;
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/CombinedRangeCategoryPlot.java File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/CombinedRangeXYPlot.java
Method name: Object clone() Method name: Object clone()
Number of AST nodes: 9 Number of AST nodes: 9
1
CombinedRangeCategoryPlot result 
1
CombinedRangeXYPlot result 
2
            = (CombinedRangeCategoryPlot) super.clone(); 
2
= (CombinedRangeXYPlot) super.clone();
3
        result.subplots = (List) ObjectUtilities.deepClone(this.subplots);
3
        result.subplots = (List) ObjectUtilities.deepClone(this.subplots);
4
        for (Iterator it = result.subplots.iterator(); it.hasNext();) {
4
        for (Iterator it = result.subplots.iterator(); it.hasNext();) {
5
            Plot child = (Plot) it.next();
5
            Plot child = (Plot) it.next();
6
            child.setParent(result);
6
            child.setParent(result);
7
        }
7
        }
8
        
9
        // after setting up all the subplots, the shared range axis may need 
8
        // after setting up all the subplots, the shared range axis may need
10
        // reconfiguring
9
        // reconfiguring
11
        ValueAxis rangeAxis = result.getRangeAxis();
10
        ValueAxis rangeAxis = result.getRangeAxis();
12
        if (rangeAxis != null) {
11
        if (rangeAxis != null) {
13
            rangeAxis.configure();
12
            rangeAxis.configure();
14
        }
13
        }
15
        
16
        return result;
14
        return result;
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)1.8
Clones locationClones are in different classes having the same super class
Number of node comparisons23
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements9
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)29.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    CombinedRangeCategoryPlot result = (CombinedRangeCategoryPlot)super.clone();
    1
    CombinedRangeCategoryPlot result = (CombinedRangeCategoryPlot)super.clone();
    1
    CombinedRangeXYPlot result = (CombinedRangeXYPlot)super.clone();
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.CombinedRangeCategoryPlotorg.jfree.chart.plot.CombinedRangeXYPlotSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.plot.CombinedRangeCategoryPlotorg.jfree.chart.plot.CombinedRangeXYPlotSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.plot.CombinedRangeCategoryPlotorg.jfree.chart.plot.CombinedRangeXYPlotSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Super method call CombinedRangeCategoryPlot result=(CombinedRangeCategoryPlot)super.clone(); cannot be extracted from method
    Super method call CombinedRangeXYPlot result=(CombinedRangeXYPlot)super.clone(); cannot be extracted from method
    1
    CombinedRangeXYPlot result = (CombinedRangeXYPlot)super.clone();
    2
    result.subplots = (List)ObjectUtilities.deepClone(this.subplots);
    2
    result.subplots = (List)ObjectUtilities.deepClone(this.subplots);
    2
    result.subplots = (List)ObjectUtilities.deepClone(this.subplots);
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.CombinedRangeCategoryPlotorg.jfree.chart.plot.CombinedRangeXYPlotSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression result.subplots cannot be unified with expression result.subplots , because common superclass org.jfree.chart.plot.Plot does not declare member(s) private List#RAW subplots
    2
    result.subplots = (List)ObjectUtilities.deepClone(this.subplots);
    3
    for (Iterator it = result.subplots.iterator(); it.hasNext(); )
    3
    for (Iterator it = result.subplots.iterator(); it.hasNext(); )
    3
    for (Iterator it = result.subplots.iterator(); it.hasNext(); )
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.CombinedRangeCategoryPlotorg.jfree.chart.plot.CombinedRangeXYPlotSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression result.subplots cannot be unified with expression result.subplots , because common superclass org.jfree.chart.plot.Plot does not declare member(s) private List#RAW subplots
    3
    for (Iterator it = result.subplots.iterator(); it.hasNext(); )
    4
    Plot child = (Plot)it.next();
    4
    Plot child = (Plot)it.next();
    5
    child.setParent(result);
    5
    child.setParent(result);
    5
    child.setParent(result);
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.CombinedRangeCategoryPlotorg.jfree.chart.plot.CombinedRangeXYPlotSUBCLASS_TYPE_MISMATCH
    5
    child.setParent(result);
    6
    ValueAxis rangeAxis = result.getRangeAxis();
    6
    ValueAxis rangeAxis = result.getRangeAxis();
    6
    ValueAxis rangeAxis = result.getRangeAxis();
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.CombinedRangeCategoryPlotorg.jfree.chart.plot.CombinedRangeXYPlotSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression result cannot be unified with expression result , because common superclass org.jfree.chart.plot.Plot does not declare member(s) public org.jfree.chart.axis.ValueAxis getRangeAxis()
    6
    ValueAxis rangeAxis = result.getRangeAxis();
    7
    if (rangeAxis != null)
    7
    if (rangeAxis != null)
    8
    rangeAxis.configure();
    8
    rangeAxis.configure();
    9
    return result;
    9
    return result;
    9
    return result;
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.CombinedRangeCategoryPlotorg.jfree.chart.plot.CombinedRangeXYPlotSUBCLASS_TYPE_MISMATCH
    9
    return result;
    Precondition Violations (5)
    Row Violation
    1Super method call CombinedRangeCategoryPlot result=(CombinedRangeCategoryPlot)super.clone(); cannot be extracted from method
    2Super method call CombinedRangeXYPlot result=(CombinedRangeXYPlot)super.clone(); cannot be extracted from method
    3Expression result.subplots cannot be unified with expression result.subplots , because common superclass org.jfree.chart.plot.Plot does not declare member(s) private List#RAW subplots
    4Expression result.subplots cannot be unified with expression result.subplots , because common superclass org.jfree.chart.plot.Plot does not declare member(s) private List#RAW subplots
    5Expression result cannot be unified with expression result , because common superclass org.jfree.chart.plot.Plot does not declare member(s) public org.jfree.chart.axis.ValueAxis getRangeAxis()