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.rangeAxes.size(); i++) { ValueAxis yAxis = (ValueAxis) this.rangeAxes.get(i); if (yAxis != null) { yAxis.setPlot(this); yAxis.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.rangeAxes.size(); i++) {
2
            ValueAxis rangeAxis = (ValueAxis) this.rangeAxes.get(i);
2
            ValueAxis yAxis = (ValueAxis) this.rangeAxes.get(i);
3
            if (rangeAxis != null) {
3
            if (yAxis != null) {
4
                rangeAxis.zoomRange(lowerPercent, upperPercent
4
                yAxis.setPlot(this);
5
);
5
                yAxis.addChangeListener(this);
6
            }
6
            }
7
        }
7
        }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
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. {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)40.8
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    for (int i = 0; i < this.rangeAxes.size(); i++)
    13
    for (int i = 0; i < this.rangeAxes.size(); i++)
    2
    ValueAxis rangeAxis = (ValueAxis)this.rangeAxes.get(i);
    2
    ValueAxis rangeAxis = (ValueAxis)this.rangeAxes.get(i);
    14
    ValueAxis yAxis = (ValueAxis)this.rangeAxes.get(i);
    Differences
    Expression1Expression2Difference
    rangeAxisyAxisVARIABLE_NAME_MISMATCH
    14
    ValueAxis yAxis = (ValueAxis)this.rangeAxes.get(i);
    3
    if (rangeAxis != null)
    3
    if (rangeAxis != null)
    15
    if (yAxis != null)
    Differences
    Expression1Expression2Difference
    rangeAxisyAxisVARIABLE_NAME_MISMATCH
    15
    if (yAxis != null)
    4
    rangeAxis.zoomRange(lowerPercent, upperPercent);
    4
    rangeAxis.zoomRange(lowerPercent, upperPercent);
    16
    yAxis.setPlot(this);
    Differences
    Expression1Expression2Difference
    zoomRangesetPlotMETHOD_INVOCATION_NAME_MISMATCH
    rangeAxisyAxisVARIABLE_NAME_MISMATCH
    rangeAxis.zoomRange(lowerPercent,upperPercent)yAxis.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 yAxis.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 yAxis.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 yAxis.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 yAxis.setPlot(this) is a void method call, and thus it cannot be parameterized
    16
    yAxis.setPlot(this);
                                                                        
    17
    yAxis.addChangeListener(this);
    Preondition Violations
    Unmatched statement yAxis.addChangeListener(this); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    17
    yAxis.addChangeListener(this);
    Precondition Violations (9)
    Row Violation
    1Expression rangeAxis.zoomRange(lowerPercent,upperPercent) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression yAxis.setPlot(this) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression rangeAxis.zoomRange(lowerPercent,upperPercent) is a void method call, and thus it cannot be parameterized
    4Expression yAxis.setPlot(this) is a void method call, and thus it cannot be parameterized
    5Expression rangeAxis.zoomRange(lowerPercent,upperPercent) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression yAxis.setPlot(this) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression rangeAxis.zoomRange(lowerPercent,upperPercent) is a void method call, and thus it cannot be parameterized
    8Expression yAxis.setPlot(this) is a void method call, and thus it cannot be parameterized
    9Unmatched statement yAxis.addChangeListener(this); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted