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 < rangeAxisCount; i++) { Axis axis = (Axis) this.rangeAxes.get(i); if (axis != null) { axis.setPlot(this); axis.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/XYPlot.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 < rangeAxisCount; i++) {
2
            ValueAxis rangeAxis = (ValueAxis) this.rangeAxes.get(i);
2
            Axis axis = (Axis) this.rangeAxes.get(i);
3
            if (rangeAxis != null) {
3
            if (axis != null) {
4
                rangeAxis.zoomRange(lowerPercent, upperPercent
4
                axis.setPlot(this);
5
);
5
                axis.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.3
Clones locationClones are in different classes having the same super 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)29.6
    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++)
    27
    for (int i = 0; i < rangeAxisCount; i++)
    Differences
    Expression1Expression2Difference
    this.rangeAxes.size()rangeAxisCountTYPE_COMPATIBLE_REPLACEMENT
    27
    for (int i = 0; i < rangeAxisCount; i++)
    2
    ValueAxis rangeAxis = (ValueAxis)this.rangeAxes.get(i);
    2
    ValueAxis rangeAxis = (ValueAxis)this.rangeAxes.get(i);
    28
    Axis axis = (Axis)this.rangeAxes.get(i);
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.ValueAxisorg.jfree.chart.axis.AxisSUBCLASS_TYPE_MISMATCH
    rangeAxisaxisVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.ValueAxisorg.jfree.chart.axis.AxisSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.axis.ValueAxisorg.jfree.chart.axis.AxisSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression (ValueAxis)this.rangeAxes.get(i) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression (Axis)this.rangeAxes.get(i) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    28
    Axis axis = (Axis)this.rangeAxes.get(i);
    3
    if (rangeAxis != null)
    3
    if (rangeAxis != null)
    29
    if (axis != null)
    Differences
    Expression1Expression2Difference
    rangeAxisaxisVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.ValueAxisorg.jfree.chart.axis.AxisSUBCLASS_TYPE_MISMATCH
    29
    if (axis != null)
    4
    rangeAxis.zoomRange(lowerPercent, upperPercent);
    4
    rangeAxis.zoomRange(lowerPercent, upperPercent);
    30
    axis.setPlot(this);
    Differences
    Expression1Expression2Difference
    zoomRangesetPlotMETHOD_INVOCATION_NAME_MISMATCH
    rangeAxisaxisVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.ValueAxisorg.jfree.chart.axis.AxisSUBCLASS_TYPE_MISMATCH
    rangeAxis.zoomRange(lowerPercent,upperPercent)axis.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 axis.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 axis.setPlot(this) is a void method call, and thus it cannot be parameterized
    Expression rangeAxis.zoomRange(lowerPercent,upperPercent) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression axis.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 axis.setPlot(this) is a void method call, and thus it cannot be parameterized
    30
    axis.setPlot(this);
                                                                      
    31
    axis.addChangeListener(this);
    Preondition Violations
    Unmatched statement axis.addChangeListener(this); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    31
    axis.addChangeListener(this);
    Precondition Violations (12)
    Row Violation
    1Expression (ValueAxis)this.rangeAxes.get(i) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression (Axis)this.rangeAxes.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 axis.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 axis.setPlot(this) is a void method call, and thus it cannot be parameterized
    7Expression rangeAxis.zoomRange(lowerPercent,upperPercent) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression axis.setPlot(this) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression rangeAxis.zoomRange(lowerPercent,upperPercent) is a void method call, and thus it cannot be parameterized
    10Expression axis.setPlot(this) is a void method call, and thus it cannot be parameterized
    11Unmatched statement axis.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 , while Clone fragment #2 returns variables axis