Shape[] shapes = new Shape[count]; for (int idx=0; idx < count; idx++) { shapes[idx] = nextShape(); } return shapes;
Paint[] pts = new Paint[count]; for (int idx=0; idx < count; idx++) { pts[idx] = nextPaint(); } return pts;
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/visualizers/LineGraph.java
Method name: Shape[] createShapes(int) Method name: Paint[] createPaint(int)
Number of AST nodes: 4 Number of AST nodes: 4
1
Shape[] shapes = new Shape[count];
1
Paint[] pts = new Paint[count];
2
        for (int idx=0; idx < count; idx++) {
2
        for (int idx=0; idx < count; idx++) {
3
            shapes[idx] = nextShape();
3
            pts[idx] = nextPaint();
4
        }
4
        }
5
        return shapes;
5
        return pts;
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)1.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                                                    
    1
    Paint[] pts = new Paint[count];
    1
    Shape[] shapes = new Shape[count];
                                                                          
    2
    for (int idx = 0; idx < count; idx++)
    2
    for (int idx = 0; idx < count; idx++)
                                                    
    3
    pts[idx] = nextPaint();
    Preondition Violations
    Unmatched statement pts[idx]=nextPaint(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3
    pts[idx] = nextPaint();
    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 pts;
    Preondition Violations
    Unmatched return pts;
    4
    return pts;
    4
    return shapes;
    4
    return shapes;
    Preondition Violations
    Unmatched return shapes;
                                      
    Precondition Violations (4)
    Row Violation
    1Unmatched statement pts[idx]=nextPaint(); 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 pts;
    4Unmatched return shapes;