Shape[] shapes = new Shape[count]; for (int idx=0; idx < count; idx++) { shapes[idx] = nextShape(); } return shapes;
Stroke[] str = new Stroke[count]; for (int idx=0; idx < count; idx++) { str[idx] = nextStroke(); } return str;
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/testelement/LineChart.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/testelement/LineChart.java
Method name: Shape[] createShapes(int) Method name: Stroke[] createStrokes(int)
Number of AST nodes: 4 Number of AST nodes: 4
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();
3
            str[idx] = nextStroke();
4
        }
4
        }
5
        return shapes;
5
        return str;
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 declared in the same class
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.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                                                        
    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();
    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
    3
    str[idx] = nextStroke();
    3
    shapes[idx] = nextShape();
    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
                                                          
                                
    4
    return str;
    Preondition Violations
    Unmatched return str;
    4
    return str;
    4
    return shapes;
    4
    return shapes;
    Preondition Violations
    Unmatched return shapes;
                                      
    Precondition Violations (4)
    Row Violation
    1Unmatched statement str[idx]=nextStroke(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement shapes[idx]=nextShape(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Unmatched return str;
    4Unmatched return shapes;