for (int i = 0; i < 4; i++) { assertEquals(1, counter); counter = 0; TestElement sampler = null; while ((sampler = controller.next()) != null) { assertEquals("one", sampler.getName()); counter++; } }
for (int i = 0; i < 2; i++) { assertEquals(15, counter); counter = 0; TestElement sampler = null; while ((sampler = controller.next()) != null) { assertEquals(order[counter++], sampler.getName()); } }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/control/TestInterleaveControl.java File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/control/TestLoopController.java
Method name: void testProcessing6() Method name: void testProcessing()
Number of AST nodes: 7 Number of AST nodes: 6
1
for (int i = 0; i < 4; i++) {
1
for (int i = 0; i < 2; i++) {
2
				assertEquals(1, counter);
2
				assertEquals(15, counter);
3
				counter = 0;
3
				counter = 0;
4
				TestElement sampler = null;
4
				TestElement sampler = null;
5
				while ((sampler = controller.next()) != null) {
5
				while ((sampler = controller.next()) != null) {
6
					assertEquals("one", sampler.getName());
6
					assertEquals(order[counter++], sampler.getName());
7
					counter++;
7
				
8
				}
8
}
9
			}
9
			}
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 having the same super class
Number of node comparisons24
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements6
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)6.6
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    15
    for (int i = 0; i < 4; i++)
    15
    for (int i = 0; i < 4; i++)
    23
    for (int i = 0; i < 2; i++)
    Differences
    Expression1Expression2Difference
    42LITERAL_VALUE_MISMATCH
    23
    for (int i = 0; i < 2; i++)
    16
    assertEquals(1, counter);
    16
    assertEquals(1, counter);
    24
    assertEquals(15, counter);
    Differences
    Expression1Expression2Difference
    115LITERAL_VALUE_MISMATCH
    24
    assertEquals(15, counter);
    17
    counter = 0;
    25
    counter = 0;
    18
    TestElement sampler = null;
    26
    TestElement sampler = null;
    19
    while ((sampler = controller.next()) != null)
    27
    while ((sampler = controller.next()) != null)
    20
    assertEquals("one", sampler.getName());
    20
    assertEquals("one", sampler.getName());
    28
    assertEquals(order[counter++], sampler.getName());
    Differences
    Expression1Expression2Difference
    "one"order[counter++]TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression order[counter++] cannot be parameterized, because it has dependencies to/from statements that will be extracted
    28
    assertEquals(order[counter++], sampler.getName());
    21
    counter++;
    21
    counter++;
    Preondition Violations
    Unmatched statement counter++; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                
    Precondition Violations (3)
    Row Violation
    1Expression order[counter++] cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Unmatched statement counter++; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Clone fragment #1 returns variables counter , while Clone fragment #2 returns variables