for (int i = 0; i < domainAxisCount; i++) { Axis axis = (Axis) this.domainAxes.get(i); if (axis != null) { axis.setPlot(this); axis.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/XYPlot.java File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/XYPlot.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 < domainAxisCount; i++) {
1
for (int i = 0; i < this.rangeAxes.size(); i++) {
2
            Axis axis = (Axis) this.domainAxes.get(i);
2
            ValueAxis rangeAxis = (ValueAxis) this.rangeAxes.get(i);
3
            if (axis != null) {
3
            if (rangeAxis != null) {
4
                axis.setPlot(this);
4
                
5
                axis.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)6.5
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    21
    for (int i = 0; i < domainAxisCount; i++)
    21
    for (int i = 0; i < domainAxisCount; i++)
    1
    for (int i = 0; i < this.rangeAxes.size(); i++)
    Differences
    Expression1Expression2Difference
    domainAxisCountthis.rangeAxes.size()TYPE_COMPATIBLE_REPLACEMENT
    1
    for (int i = 0; i < this.rangeAxes.size(); i++)
    22
    Axis axis = (Axis)this.domainAxes.get(i);
    22
    Axis axis = (Axis)this.domainAxes.get(i);
    2
    ValueAxis rangeAxis = (ValueAxis)this.rangeAxes.get(i);
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.Axisorg.jfree.chart.axis.ValueAxisSUBCLASS_TYPE_MISMATCH
    axisrangeAxisVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.Axisorg.jfree.chart.axis.ValueAxisSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.axis.Axisorg.jfree.chart.axis.ValueAxisSUBCLASS_TYPE_MISMATCH
    domainAxesrangeAxesVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression (Axis)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);
    23
    if (axis != null)
    23
    if (axis != null)
    3
    if (rangeAxis != null)
    Differences
    Expression1Expression2Difference
    axisrangeAxisVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.Axisorg.jfree.chart.axis.ValueAxisSUBCLASS_TYPE_MISMATCH
    3
    if (rangeAxis != null)
    24
    axis.setPlot(this);
    24
    axis.setPlot(this);
    4
    rangeAxis.zoomRange(lowerPercent, upperPercent);
    Differences
    Expression1Expression2Difference
    setPlotzoomRangeMETHOD_INVOCATION_NAME_MISMATCH
    axisrangeAxisVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.Axisorg.jfree.chart.axis.ValueAxisSUBCLASS_TYPE_MISMATCH
    axis.setPlot(this)rangeAxis.zoomRange(lowerPercent,upperPercent)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression axis.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 axis.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 axis.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 axis.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);
    25
    axis.addChangeListener(this);
    25
    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
                                                                      
    Precondition Violations (12)
    Row Violation
    1Expression (Axis)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 axis.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 axis.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 axis.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 axis.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 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 axis , while Clone fragment #2 returns variables