for (int i = 0; i < this.domainAxes.size(); i++) { ValueAxis domainAxis = (ValueAxis) this.domainAxes.get(i); if (domainAxis != null) { domainAxis.zoomRange(lowerPercent, upperPercent); } }
for (int i = 0; i < domainAxisCount; i++) { Axis axis = (Axis) this.domainAxes.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/XYPlot.java File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/XYPlot.java
Method name: void zoomDomainAxes(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.domainAxes.size(); i++) {
1
for (int i = 0; i < domainAxisCount; i++) {
2
            ValueAxis domainAxis = (ValueAxis) this.domainAxes.get(i);
2
            Axis axis = (Axis) this.domainAxes.get(i);
3
            if (domainAxis != null) {
3
            if (axis != null) {
4
                domainAxis.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 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)180.3
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    for (int i = 0; i < this.domainAxes.size(); i++)
    1
    for (int i = 0; i < this.domainAxes.size(); i++)
    21
    for (int i = 0; i < domainAxisCount; i++)
    Differences
    Expression1Expression2Difference
    this.domainAxes.size()domainAxisCountTYPE_COMPATIBLE_REPLACEMENT
    21
    for (int i = 0; i < domainAxisCount; i++)
    2
    ValueAxis domainAxis = (ValueAxis)this.domainAxes.get(i);
    2
    ValueAxis domainAxis = (ValueAxis)this.domainAxes.get(i);
    22
    Axis axis = (Axis)this.domainAxes.get(i);
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.ValueAxisorg.jfree.chart.axis.AxisSUBCLASS_TYPE_MISMATCH
    domainAxisaxisVARIABLE_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.domainAxes.get(i) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression (Axis)this.domainAxes.get(i) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    22
    Axis axis = (Axis)this.domainAxes.get(i);
    3
    if (domainAxis != null)
    3
    if (domainAxis != null)
    23
    if (axis != null)
    Differences
    Expression1Expression2Difference
    domainAxisaxisVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.ValueAxisorg.jfree.chart.axis.AxisSUBCLASS_TYPE_MISMATCH
    23
    if (axis != null)
    4
    domainAxis.zoomRange(lowerPercent, upperPercent);
    4
    domainAxis.zoomRange(lowerPercent, upperPercent);
    24
    axis.setPlot(this);
    Differences
    Expression1Expression2Difference
    zoomRangesetPlotMETHOD_INVOCATION_NAME_MISMATCH
    domainAxisaxisVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.ValueAxisorg.jfree.chart.axis.AxisSUBCLASS_TYPE_MISMATCH
    domainAxis.zoomRange(lowerPercent,upperPercent)axis.setPlot(this)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression domainAxis.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 domainAxis.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 domainAxis cannot be unified with expression axis , because common superclass org.jfree.chart.axis.Axis does not declare member(s) public void zoomRange(double, double)
    Expression domainAxis.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 domainAxis.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
    24
    axis.setPlot(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
    25
    axis.addChangeListener(this);
    Precondition Violations (13)
    Row Violation
    1Expression (ValueAxis)this.domainAxes.get(i) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression (Axis)this.domainAxes.get(i) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression domainAxis.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 domainAxis.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 domainAxis cannot be unified with expression axis , because common superclass org.jfree.chart.axis.Axis does not declare member(s) public void zoomRange(double, double)
    8Expression domainAxis.zoomRange(lowerPercent,upperPercent) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression axis.setPlot(this) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression domainAxis.zoomRange(lowerPercent,upperPercent) is a void method call, and thus it cannot be parameterized
    11Expression axis.setPlot(this) is a void method call, and thus it cannot be parameterized
    12Unmatched statement axis.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 axis