CombinedDomainXYPlot result = (CombinedDomainXYPlot) 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 domain axis may need // reconfiguring ValueAxis domainAxis = result.getDomainAxis(); if (domainAxis != null) { domainAxis.configure(); } return result;
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;
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/CombinedDomainXYPlot.java File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/CombinedRangeCategoryPlot.java
Method name: Object clone() Method name: Object clone()
Number of AST nodes: 9 Number of AST nodes: 9
1
CombinedDomainXYPlot result = (CombinedDomainXY
1
CombinedRangeCategoryPlot result 
2
Plot) super.clone();
2
            = (CombinedRangeCategoryPlot) 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
        
8
        // after setting up all the subplots, the shared domain axis may need
9
        // after setting up all the subplots, the shared range axis may need 
9
        // reconfiguring
10
        // reconfiguring
10
        ValueAxis domainAxis = result.getDomainAxis();
11
        ValueAxis rangeAxis = result.getRangeAxis();
11
        if (domainAxis != null) {
12
        if (rangeAxis != null) {
12
            domainAxis.configure();
13
            rangeAxis.configure();
13
        }
14
        }
15
        
14
        return result;
16
        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)0.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)129.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    CombinedDomainXYPlot result = (CombinedDomainXYPlot)super.clone();
    1
    CombinedDomainXYPlot result = (CombinedDomainXYPlot)super.clone();
    1
    CombinedRangeCategoryPlot result = (CombinedRangeCategoryPlot)super.clone();
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.CombinedDomainXYPlotorg.jfree.chart.plot.CombinedRangeCategoryPlotSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.plot.CombinedDomainXYPlotorg.jfree.chart.plot.CombinedRangeCategoryPlotSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.plot.CombinedDomainXYPlotorg.jfree.chart.plot.CombinedRangeCategoryPlotSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Super method call CombinedDomainXYPlot result=(CombinedDomainXYPlot)super.clone(); cannot be extracted from method
    Super method call CombinedRangeCategoryPlot result=(CombinedRangeCategoryPlot)super.clone(); cannot be extracted from method
    1
    CombinedRangeCategoryPlot result = (CombinedRangeCategoryPlot)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.CombinedDomainXYPlotorg.jfree.chart.plot.CombinedRangeCategoryPlotSUBCLASS_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.CombinedDomainXYPlotorg.jfree.chart.plot.CombinedRangeCategoryPlotSUBCLASS_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.CombinedDomainXYPlotorg.jfree.chart.plot.CombinedRangeCategoryPlotSUBCLASS_TYPE_MISMATCH
    5
    child.setParent(result);
    6
    ValueAxis domainAxis = result.getDomainAxis();
    6
    ValueAxis domainAxis = result.getDomainAxis();
    6
    ValueAxis rangeAxis = result.getRangeAxis();
    Differences
    Expression1Expression2Difference
    domainAxisrangeAxisVARIABLE_NAME_MISMATCH
    getDomainAxisgetRangeAxisMETHOD_INVOCATION_NAME_MISMATCH
    org.jfree.chart.plot.CombinedDomainXYPlotorg.jfree.chart.plot.CombinedRangeCategoryPlotSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression result.getDomainAxis() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression result.getRangeAxis() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    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 getDomainAxis() , public org.jfree.chart.axis.ValueAxis getRangeAxis()
    6
    ValueAxis rangeAxis = result.getRangeAxis();
    7
    if (domainAxis != null)
    7
    if (domainAxis != null)
    7
    if (rangeAxis != null)
    Differences
    Expression1Expression2Difference
    domainAxisrangeAxisVARIABLE_NAME_MISMATCH
    7
    if (rangeAxis != null)
    8
    domainAxis.configure();
    8
    domainAxis.configure();
    8
    rangeAxis.configure();
    Differences
    Expression1Expression2Difference
    domainAxisrangeAxisVARIABLE_NAME_MISMATCH
    8
    rangeAxis.configure();
    9
    return result;
    9
    return result;
    9
    return result;
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.CombinedDomainXYPlotorg.jfree.chart.plot.CombinedRangeCategoryPlotSUBCLASS_TYPE_MISMATCH
    9
    return result;
    Precondition Violations (7)
    Row Violation
    1Super method call CombinedDomainXYPlot result=(CombinedDomainXYPlot)super.clone(); cannot be extracted from method
    2Super method call CombinedRangeCategoryPlot result=(CombinedRangeCategoryPlot)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.getDomainAxis() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression result.getRangeAxis() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression 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 getDomainAxis() , public org.jfree.chart.axis.ValueAxis getRangeAxis()