for (int x = 0; x < groups; x++) { buf.append(x); vars.put(buf.toString(), match.group(x)); buf.setLength(pfxlen); }
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/extractor/RegexExtractor.java File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/control/TestThroughputController.java
Method name: void saveGroups(JMeterVariables, String, MatchResult) Method name: void testByNumber()
Number of AST nodes: 4 Number of AST nodes: 4
1
for (int x = 0; x < groups; x++) {
1
for (int 
2
			buf.append(x);
3
			vars.put(buf.toString(), match.group(x));
4
			buf.setLength(pfxlen
2
counter = 0; counter < order.length; counter++) {
3
				TestElement sampler = test.next();
4
				assertNotNull(sampler);
5
);
5
				assertEquals("Counter: " + counter, order[counter], sampler.getName());
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.1
Clones locationClones are in different classes
Number of node comparisons16
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)662.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    11
    for (int x = 0; x < groups; x++)
    11
    for (int x = 0; x < groups; x++)
    21
    for (int counter = 0; counter < order.length; counter++)
    Differences
    Expression1Expression2Difference
    xcounterVARIABLE_NAME_MISMATCH
    xcounterVARIABLE_NAME_MISMATCH
    groupsorder.lengthTYPE_COMPATIBLE_REPLACEMENT
    xcounterVARIABLE_NAME_MISMATCH
    21
    for (int counter = 0; counter < order.length; counter++)
    12
    buf.append(x);
    12
    buf.append(x);
    Preondition Violations
    Unmatched statement buf.append(x); 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();
    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();
    13
    vars.put(buf.toString(), match.group(x));
    13
    vars.put(buf.toString(), match.group(x));
    23
    assertNotNull(sampler);
    Differences
    Expression1Expression2Difference
    putassertNotNullMETHOD_INVOCATION_NAME_MISMATCH
    vars.put(buf.toString(),match.group(x))assertNotNull(sampler)ARGUMENT_NUMBER_MISMATCH
    varsMISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression vars.put(buf.toString(),match.group(x)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression vars.put(buf.toString(),match.group(x)) is a void method call, and thus it cannot be parameterized
    Expression assertNotNull(sampler) is a void method call, and thus it cannot be parameterized
    Expression vars.put(buf.toString(),match.group(x)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression vars.put(buf.toString(),match.group(x)) is a void method call, and thus it cannot be parameterized
    Expression assertNotNull(sampler) is a void method call, and thus it cannot be parameterized
    23
    assertNotNull(sampler);
    14
    buf.setLength(pfxlen);
    14
    buf.setLength(pfxlen);
    24
    assertEquals("Counter: " + counter, order[counter], sampler.getName());
    Differences
    Expression1Expression2Difference
    setLengthassertEqualsMETHOD_INVOCATION_NAME_MISMATCH
    buf.setLength(pfxlen)assertEquals("Counter: " + counter,order[counter],sampler.getName())ARGUMENT_NUMBER_MISMATCH
    bufMISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression buf.setLength(pfxlen) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression assertEquals("Counter: " + counter,order[counter],sampler.getName()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression buf.setLength(pfxlen) is a void method call, and thus it cannot be parameterized
    Expression assertEquals("Counter: " + counter,order[counter],sampler.getName()) is a void method call, and thus it cannot be parameterized
    Expression buf.setLength(pfxlen) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression assertEquals("Counter: " + counter,order[counter],sampler.getName()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression buf.setLength(pfxlen) is a void method call, and thus it cannot be parameterized
    Expression assertEquals("Counter: " + counter,order[counter],sampler.getName()) is a void method call, and thus it cannot be parameterized
    24
    assertEquals("Counter: " + counter, order[counter], sampler.getName());
    Precondition Violations (17)
    Row Violation
    1Unmatched statement buf.append(x); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched 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
    3Expression vars.put(buf.toString(),match.group(x)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression vars.put(buf.toString(),match.group(x)) is a void method call, and thus it cannot be parameterized
    5Expression assertNotNull(sampler) is a void method call, and thus it cannot be parameterized
    6Expression vars.put(buf.toString(),match.group(x)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression vars.put(buf.toString(),match.group(x)) is a void method call, and thus it cannot be parameterized
    8Expression assertNotNull(sampler) is a void method call, and thus it cannot be parameterized
    9Expression buf.setLength(pfxlen) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression assertEquals("Counter: " + counter,order[counter],sampler.getName()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression buf.setLength(pfxlen) is a void method call, and thus it cannot be parameterized
    12Expression assertEquals("Counter: " + counter,order[counter],sampler.getName()) is a void method call, and thus it cannot be parameterized
    13Expression buf.setLength(pfxlen) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14Expression assertEquals("Counter: " + counter,order[counter],sampler.getName()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    15Expression buf.setLength(pfxlen) is a void method call, and thus it cannot be parameterized
    16Expression assertEquals("Counter: " + counter,order[counter],sampler.getName()) is a void method call, and thus it cannot be parameterized
    17Clone fragment #1 returns variables x , while Clone fragment #2 returns variables