Stroke[] str = new Stroke[count]; for (int idx=0; idx < count; idx++) { str[idx] = nextStroke(); } return str;
Shape[] shapes = new Shape[count]; for (int idx=0; idx < count; idx++) { shapes[idx] = nextShape(); } return shapes;
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/visualizers/LineGraph.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/testelement/LineChart.java
Method name: Stroke[] createStrokes(int) Method name: Shape[] createShapes(int)
Number of AST nodes: 4 Number of AST nodes: 4
1
Stroke[] str = new Stroke[count];
1
Shape[] shapes = new Shape[count];
2
        for (int idx=0; idx < count; idx++) {
2
        for (int idx=0; idx < count; idx++) {
3
            str[idx] = nextStroke();
3
            shapes[idx] = nextShape();
4
        }
4
        }
5
        return str;
5
        return shapes;
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.2
Clones locationClones are in different classes
Number of node comparisons8
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment3
    Number of unmapped statements in the second code fragment3
    Time elapsed for statement mapping (ms)0.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                                                          
    1
    Shape[] shapes = new Shape[count];
    1
    Stroke[] str = new Stroke[count];
                                                                        
    2
    for (int idx = 0; idx < count; idx++)
    2
    for (int idx = 0; idx < count; idx++)
                                                          
    3
    shapes[idx] = nextShape();
    Preondition Violations
    Unmatched statement shapes[idx]=nextShape(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3
    shapes[idx] = nextShape();
    3
    str[idx] = nextStroke();
    3
    str[idx] = nextStroke();
    Preondition Violations
    Unmatched statement str[idx]=nextStroke(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                      
                                      
    4
    return shapes;
    Preondition Violations
    Unmatched return shapes;
    4
    return shapes;
    4
    return str;
    4
    return str;
    Preondition Violations
    Unmatched return str;
                                
    Precondition Violations (4)
    Row Violation
    1Unmatched statement shapes[idx]=nextShape(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement str[idx]=nextStroke(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Unmatched return shapes;
    4Unmatched return str;