for (int idx=0; idx < text.length; idx++) { if (idx > 0) { cat.append(CLASSPATH_SEPARATOR); } cat.append(text[idx]); }
for (int i=0; i < headers.length; i++){ if (i>0) { writer.write(DELIM); } writer.write(quoteDelimiters(headers[i],SPECIALS)); }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/testelement/TestPlan.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/save/CSVSaveService.java
Method name: void setTestPlanClasspathArray(String[]) Method name: void saveCSVStats(Vector, FileWriter, String[])
Number of AST nodes: 4 Number of AST nodes: 4
1
for (int idx=0; idx < text.length; idx++) {
1
for (int i=0; i < headers.length; i++){
2
            if (idx > 0) {
2
        		if (i>0) {
3
                cat.append(CLASSPATH_SEPARATOR);
3
        			writer.write(DELIM);
4
            }
4
        		}
5
            cat.append(text[idx]);
5
        		writer.write(quoteDelimiters(headers[i],SPECIALS));
6
        }
6
        	}
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.3
Clones locationClones are in different classes
Number of node comparisons8
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    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.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    2
    for (int idx = 0; idx < text.length; idx++)
    2
    for (int idx = 0; idx < text.length; idx++)
    5
    for (int i = 0; i < headers.length; i++)
    Differences
    Expression1Expression2Difference
    idxiVARIABLE_NAME_MISMATCH
    idxiVARIABLE_NAME_MISMATCH
    textheadersVARIABLE_NAME_MISMATCH
    idxiVARIABLE_NAME_MISMATCH
    5
    for (int i = 0; i < headers.length; i++)
    3
    if (idx > 0)
    3
    if (idx > 0)
    6
    if (i > 0)
    Differences
    Expression1Expression2Difference
    idxiVARIABLE_NAME_MISMATCH
    6
    if (i > 0)
    4
    cat.append(CLASSPATH_SEPARATOR);
    4
    cat.append(CLASSPATH_SEPARATOR);
    Preondition Violations
    Unmatched statement cat.append(CLASSPATH_SEPARATOR); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                          
                                                  
    7
    writer.write(DELIM);
    Preondition Violations
    Unmatched statement writer.write(DELIM); 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
    7
    writer.write(DELIM);
    5
    cat.append(text[idx]);
    5
    cat.append(text[idx]);
    Preondition Violations
    Unmatched statement cat.append(text[idx]); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                      
                                                                                                                
    8
    writer.write(quoteDelimiters(headers[i], SPECIALS));
    Preondition Violations
    Unmatched statement writer.write(quoteDelimiters(headers[i],SPECIALS)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    Unmatched statement writer.write(quoteDelimiters(headers[i],SPECIALS)); 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
    8
    writer.write(quoteDelimiters(headers[i], SPECIALS));
    Precondition Violations (5)
    Row Violation
    1Unmatched statement cat.append(CLASSPATH_SEPARATOR); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2Unmatched statement writer.write(DELIM); 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
    3Unmatched statement cat.append(text[idx]); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4Unmatched statement writer.write(quoteDelimiters(headers[i],SPECIALS)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5Unmatched statement writer.write(quoteDelimiters(headers[i],SPECIALS)); 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