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