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 c = 0; c < this.data.getColumnCount(); c++) { Number value = this.data.getValue(r, c); if (value != null) { unique.add(value); } }
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/data/general/WaferMapDataset.java
Method name: void zoomRangeAxes(double, double, PlotRenderingInfo, Point2D) Method name: Set getUniqueValues()
Number of AST nodes: 4 Number of AST nodes: 4
1
for (int i = 0; i < this.rangeAxes.size(); i++) {
1
for (int c = 0; c < this.data.getColumnCount(); c++) {
2
            ValueAxis rangeAxis = (ValueAxis) this.rangeAxes.get(i);
2
                Number value = this.data.getValue(r, c);
3
            if (rangeAxis != null) {
3
                if (value != null) {
4
                rangeAxis.zoomRange(lowerPercent, upperPercent);
4
                    unique.add(value);
5
            }
5
            
6
    }
6
        }
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.6
Clones locationClones are in different classes
Number of node comparisons6
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)1.3
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    2
    ValueAxis rangeAxis = (ValueAxis)this.rangeAxes.get(i);
    2
    ValueAxis rangeAxis = (ValueAxis)this.rangeAxes.get(i);
    Preondition Violations
    Unmatched statement ValueAxis rangeAxis=(ValueAxis)this.rangeAxes.get(i); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                    
                                                                                    
    4
    Number value = this.data.getValue(r, c);
    Preondition Violations
    Unmatched statement Number value=this.data.getValue(r,c); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4
    Number value = this.data.getValue(r, c);
    3
    if (rangeAxis != null)
    3
    if (rangeAxis != null)
    5
    if (value != null)
    Differences
    Expression1Expression2Difference
    rangeAxisvalueVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.ValueAxisjava.lang.NumberVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.axis.ValueAxis of variable rangeAxis does not match with type java.lang.Number of variable value
    • Make classes org.jfree.chart.axis.ValueAxis and java.lang.Number extend a common superclass
    5
    if (value != null)
    4
    rangeAxis.zoomRange(lowerPercent, upperPercent);
    4
    rangeAxis.zoomRange(lowerPercent, upperPercent);
    Preondition Violations
    Unmatched statement rangeAxis.zoomRange(lowerPercent,upperPercent); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched statement rangeAxis.zoomRange(lowerPercent,upperPercent); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
                                                                                                        
                                              
    6
    unique.add(value);
    Preondition Violations
    Unmatched statement unique.add(value); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    6
    unique.add(value);
    Precondition Violations (7)
    Row Violation
    1Unmatched statement ValueAxis rangeAxis=(ValueAxis)this.rangeAxes.get(i); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement Number value=this.data.getValue(r,c); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Type org.jfree.chart.axis.ValueAxis of variable rangeAxis does not match with type java.lang.Number of variable value
    4Unmatched statement rangeAxis.zoomRange(lowerPercent,upperPercent); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    5Unmatched statement rangeAxis.zoomRange(lowerPercent,upperPercent); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    6Unmatched statement unique.add(value); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    7The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero