for (int i = 0; i < this.rangeAxes.size(); i++) { ValueAxis rangeAxis = (ValueAxis) this.rangeAxes.get(i); if (rangeAxis != null) { rangeAxis.zoomRange(lowerPercent, upperPercent); } }
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); } }
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 zoomRangeAxes(double, double, PlotRenderingInfo, Point2D) Method name: void readObject(ObjectInputStream)
Number of AST nodes: 4 Number of AST nodes: 5
1
for (int i = 0; i < this.rangeAxes.size(); i++) {
1
for (int i = 0; i < this.domainAxes.size(); i++) {
2
            ValueAxis rangeAxis = (ValueAxis) this.rangeAxes.get(i);
2
            CategoryAxis xAxis = (CategoryAxis) this.domainAxes.get(i);
3
            if (rangeAxis != null) {
3
            if (xAxis != null) {
4
                rangeAxis.zoomRange(lowerPercent, upperPercent
4
                xAxis.setPlot(this);
5
);
5
                xAxis.addChangeListener(this);
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.4
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 fragment0
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)38.8
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    for (int i = 0; i < this.rangeAxes.size(); i++)
    1
    for (int i = 0; i < this.rangeAxes.size(); i++)
    8
    for (int i = 0; i < this.domainAxes.size(); i++)
    Differences
    Expression1Expression2Difference
    rangeAxesdomainAxesVARIABLE_NAME_MISMATCH
    8
    for (int i = 0; i < this.domainAxes.size(); i++)
    2
    ValueAxis rangeAxis = (ValueAxis)this.rangeAxes.get(i);
    2
    ValueAxis rangeAxis = (ValueAxis)this.rangeAxes.get(i);
    9
    CategoryAxis xAxis = (CategoryAxis)this.domainAxes.get(i);
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.ValueAxisorg.jfree.chart.axis.CategoryAxisSUBCLASS_TYPE_MISMATCH
    rangeAxisxAxisVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.ValueAxisorg.jfree.chart.axis.CategoryAxisSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.axis.ValueAxisorg.jfree.chart.axis.CategoryAxisSUBCLASS_TYPE_MISMATCH
    rangeAxesdomainAxesVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression (ValueAxis)this.rangeAxes.get(i) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression (CategoryAxis)this.domainAxes.get(i) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9
    CategoryAxis xAxis = (CategoryAxis)this.domainAxes.get(i);
    3
    if (rangeAxis != null)
    3
    if (rangeAxis != null)
    10
    if (xAxis != null)
    Differences
    Expression1Expression2Difference
    rangeAxisxAxisVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.ValueAxisorg.jfree.chart.axis.CategoryAxisSUBCLASS_TYPE_MISMATCH
    10
    if (xAxis != null)
    4
    rangeAxis.zoomRange(lowerPercent, upperPercent);
    4
    rangeAxis.zoomRange(lowerPercent, upperPercent);
    11
    xAxis.setPlot(this);
    Differences
    Expression1Expression2Difference
    zoomRangesetPlotMETHOD_INVOCATION_NAME_MISMATCH
    rangeAxisxAxisVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.ValueAxisorg.jfree.chart.axis.CategoryAxisSUBCLASS_TYPE_MISMATCH
    rangeAxis.zoomRange(lowerPercent,upperPercent)xAxis.setPlot(this)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression rangeAxis.zoomRange(lowerPercent,upperPercent) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression xAxis.setPlot(this) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression rangeAxis.zoomRange(lowerPercent,upperPercent) is a void method call, and thus it cannot be parameterized
    Expression xAxis.setPlot(this) is a void method call, and thus it cannot be parameterized
    Expression rangeAxis cannot be unified with expression xAxis , because common superclass org.jfree.chart.axis.Axis does not declare member(s) public void zoomRange(double, double)
    Expression rangeAxis.zoomRange(lowerPercent,upperPercent) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression xAxis.setPlot(this) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression rangeAxis.zoomRange(lowerPercent,upperPercent) is a void method call, and thus it cannot be parameterized
    Expression xAxis.setPlot(this) is a void method call, and thus it cannot be parameterized
    11
    xAxis.setPlot(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
    12
    xAxis.addChangeListener(this);
    Precondition Violations (13)
    Row Violation
    1Expression (ValueAxis)this.rangeAxes.get(i) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression (CategoryAxis)this.domainAxes.get(i) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression rangeAxis.zoomRange(lowerPercent,upperPercent) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression xAxis.setPlot(this) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression rangeAxis.zoomRange(lowerPercent,upperPercent) is a void method call, and thus it cannot be parameterized
    6Expression xAxis.setPlot(this) is a void method call, and thus it cannot be parameterized
    7Expression rangeAxis cannot be unified with expression xAxis , because common superclass org.jfree.chart.axis.Axis does not declare member(s) public void zoomRange(double, double)
    8Expression rangeAxis.zoomRange(lowerPercent,upperPercent) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression xAxis.setPlot(this) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression rangeAxis.zoomRange(lowerPercent,upperPercent) is a void method call, and thus it cannot be parameterized
    11Expression xAxis.setPlot(this) is a void method call, and thus it cannot be parameterized
    12Unmatched statement xAxis.addChangeListener(this); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    13Clone fragment #1 returns variables , while Clone fragment #2 returns variables xAxis