for (int i = 0; i < this.domainAxes.size(); i++) { CategoryAxis xAxis = (CategoryAxis) this.domainAxes.get(i); if (xAxis != null) { xAxis.setPlot(this); xAxis.addChangeListener(this); } }
for (int i = 0; i < this.rangeAxes.size(); i++) { ValueAxis rangeAxis = (ValueAxis) this.rangeAxes.get(i); if (rangeAxis != null) { rangeAxis.zoomRange(lowerPercent, upperPercent); } }
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/CategoryPlot.java File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/CategoryPlot.java
Method name: void readObject(ObjectInputStream) Method name: void zoomRangeAxes(double, double, PlotRenderingInfo, Point2D)
Number of AST nodes: 5 Number of AST nodes: 4
1
for (int i = 0; i < this.domainAxes.size(); i++) {
1
for (int i = 0; i < this.rangeAxes.size(); i++) {
2
            CategoryAxis xAxis = (CategoryAxis) this.domainAxes.get(i);
2
            ValueAxis rangeAxis = (ValueAxis) this.rangeAxes.get(i);
3
            if (xAxis != null) {
3
            if (rangeAxis != null) {
4
                xAxis.setPlot(this);
4
                
5
                xAxis.addChangeListener(this);
5
rangeAxis.zoomRange(lowerPercent, upperPercent);
6
            }
6
            }
7
        }
7
        }
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.3
Clones locationClones are declared in the same class
Number of node comparisons10
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)31.4
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    8
    for (int i = 0; i < this.domainAxes.size(); i++)
    8
    for (int i = 0; i < this.domainAxes.size(); i++)
    1
    for (int i = 0; i < this.rangeAxes.size(); i++)
    Differences
    Expression1Expression2Difference
    domainAxesrangeAxesVARIABLE_NAME_MISMATCH
    1
    for (int i = 0; i < this.rangeAxes.size(); i++)
    9
    CategoryAxis xAxis = (CategoryAxis)this.domainAxes.get(i);
    9
    CategoryAxis xAxis = (CategoryAxis)this.domainAxes.get(i);
    2
    ValueAxis rangeAxis = (ValueAxis)this.rangeAxes.get(i);
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.CategoryAxisorg.jfree.chart.axis.ValueAxisSUBCLASS_TYPE_MISMATCH
    xAxisrangeAxisVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.CategoryAxisorg.jfree.chart.axis.ValueAxisSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.axis.CategoryAxisorg.jfree.chart.axis.ValueAxisSUBCLASS_TYPE_MISMATCH
    domainAxesrangeAxesVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression (CategoryAxis)this.domainAxes.get(i) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression (ValueAxis)this.rangeAxes.get(i) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2
    ValueAxis rangeAxis = (ValueAxis)this.rangeAxes.get(i);
    10
    if (xAxis != null)
    10
    if (xAxis != null)
    3
    if (rangeAxis != null)
    Differences
    Expression1Expression2Difference
    xAxisrangeAxisVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.CategoryAxisorg.jfree.chart.axis.ValueAxisSUBCLASS_TYPE_MISMATCH
    3
    if (rangeAxis != null)
    11
    xAxis.setPlot(this);
    11
    xAxis.setPlot(this);
    4
    rangeAxis.zoomRange(lowerPercent, upperPercent);
    Differences
    Expression1Expression2Difference
    setPlotzoomRangeMETHOD_INVOCATION_NAME_MISMATCH
    xAxisrangeAxisVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.CategoryAxisorg.jfree.chart.axis.ValueAxisSUBCLASS_TYPE_MISMATCH
    xAxis.setPlot(this)rangeAxis.zoomRange(lowerPercent,upperPercent)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression xAxis.setPlot(this) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression rangeAxis.zoomRange(lowerPercent,upperPercent) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression xAxis.setPlot(this) is a void method call, and thus it cannot be parameterized
    Expression rangeAxis.zoomRange(lowerPercent,upperPercent) is a void method call, and thus it cannot be parameterized
    Expression xAxis.setPlot(this) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression rangeAxis.zoomRange(lowerPercent,upperPercent) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression xAxis.setPlot(this) is a void method call, and thus it cannot be parameterized
    Expression rangeAxis.zoomRange(lowerPercent,upperPercent) is a void method call, and thus it cannot be parameterized
    4
    rangeAxis.zoomRange(lowerPercent, upperPercent);
    12
    xAxis.addChangeListener(this);
    12
    xAxis.addChangeListener(this);
    Preondition Violations
    Unmatched statement xAxis.addChangeListener(this); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                        
    Precondition Violations (12)
    Row Violation
    1Expression (CategoryAxis)this.domainAxes.get(i) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression (ValueAxis)this.rangeAxes.get(i) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression xAxis.setPlot(this) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression rangeAxis.zoomRange(lowerPercent,upperPercent) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression xAxis.setPlot(this) is a void method call, and thus it cannot be parameterized
    6Expression rangeAxis.zoomRange(lowerPercent,upperPercent) is a void method call, and thus it cannot be parameterized
    7Expression xAxis.setPlot(this) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression rangeAxis.zoomRange(lowerPercent,upperPercent) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression xAxis.setPlot(this) is a void method call, and thus it cannot be parameterized
    10Expression rangeAxis.zoomRange(lowerPercent,upperPercent) is a void method call, and thus it cannot be parameterized
    11Unmatched statement xAxis.addChangeListener(this); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    12Clone fragment #1 returns variables xAxis , while Clone fragment #2 returns variables