for (int i = 0; i < SampleEvent.getVarCount(); i++){ text.append(VARIABLE_NAME_QUOTE_CHAR); text.append(SampleEvent.getVarName(i)); text.append(VARIABLE_NAME_QUOTE_CHAR); text.append(delim); }
for (int counter = 0; counter < order.length; counter++) { TestElement sampler = test.next(); assertNotNull(sampler); assertEquals("Counter: " + counter, order[counter], sampler.getName()); }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/save/CSVSaveService.java File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/control/TestThroughputController.java
Method name: String printableFieldNamesToString(SampleSaveConfiguration) Method name: void testByNumber()
Number of AST nodes: 5 Number of AST nodes: 4
1
for (int i = 0; i < SampleEvent.getVarCount(); i++){
1
for (int counter = 0; counter < order.length; counter++) {
2
        	text.append(VARIABLE_NAME_QUOTE_CHAR);
3
        	text.append(SampleEvent.getVarName(i));
4
        	text.append(VARIABLE_NAME_QUOTE_CHAR);
5
            text.append(delim);
6
        
2
				TestElement sampler = test.next();
3
				assertNotNull(sampler);
4
				assertEquals("Counter: " + counter, order[counter], sampler.getName());
7
}
5
			}
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 comparisons20
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment4
    Number of unmapped statements in the second code fragment3
    Time elapsed for statement mapping (ms)1.1
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    58
    for (int i = 0; i < SampleEvent.getVarCount(); i++)
    58
    for (int i = 0; i < SampleEvent.getVarCount(); i++)
    21
    for (int counter = 0; counter < order.length; counter++)
    Differences
    Expression1Expression2Difference
    icounterVARIABLE_NAME_MISMATCH
    icounterVARIABLE_NAME_MISMATCH
    SampleEvent.getVarCount()order.lengthTYPE_COMPATIBLE_REPLACEMENT
    icounterVARIABLE_NAME_MISMATCH
    21
    for (int counter = 0; counter < order.length; counter++)
                                                                            
    22
    TestElement sampler = test.next();
    Preondition Violations
    Unmatched statement TestElement sampler=test.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    22
    TestElement sampler = test.next();
                                                          
    23
    assertNotNull(sampler);
                                                                                                                                                      
    24
    assertEquals("Counter: " + counter, order[counter], sampler.getName());
    Preondition Violations
    Unmatched statement assertEquals("Counter: " + counter,order[counter],sampler.getName()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    24
    assertEquals("Counter: " + counter, order[counter], sampler.getName());
    59
    text.append(VARIABLE_NAME_QUOTE_CHAR);
                                                                                        
    60
    text.append(SampleEvent.getVarName(i));
    60
    text.append(SampleEvent.getVarName(i));
    Preondition Violations
    Unmatched statement text.append(SampleEvent.getVarName(i)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                          
    61
    text.append(VARIABLE_NAME_QUOTE_CHAR);
                                                                                        
    62
    text.append(delim);
                                                  
    Precondition Violations (3)
    Row Violation
    1Unmatched statement TestElement sampler=test.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement assertEquals("Counter: " + counter,order[counter],sampler.getName()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Unmatched statement text.append(SampleEvent.getVarName(i)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted