for (int counter = 0; counter < order.length; counter++) { TestElement sampler = test.next(); assertNotNull(sampler); assertEquals("Counter: " + counter, order[counter], sampler.getName()); }
replacer.replaceValues(model); model.startProxy(); start.setEnabled(false); stop.setEnabled(true); restart.setEnabled(false);
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/control/TestThroughputController.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/http/proxy/gui/ProxyControlGui.java
Method name: void testByNumber() Method name: void startProxy()
Number of AST nodes: 4 Number of AST nodes: 5
1
for (int counter = 0; counter < order.length; counter++) {
2
				TestElement sampler = test.next();
3
				assertNotNull(sampler
1
replacer.replaceValues(model);
2
			model.startProxy();
4
);
3
			start.setEnabled(false);
5
				assertEquals("Counter: " + counter, order[counter], sampler.getName());
4
			stop.setE
6
			}
5
nabled(true);
6
			restart.setEnabled(false);
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.0
Clones locationClones are in different classes
Number of node comparisons15
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment3
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    22
    TestElement sampler = test.next();
    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
                                                                            
    23
    assertNotNull(sampler);
    23
    assertNotNull(sampler);
    5
    model.startProxy();
    Differences
    Expression1Expression2Difference
    assertNotNullstartProxyMETHOD_INVOCATION_NAME_MISMATCH
    assertNotNull(sampler)model.startProxy()ARGUMENT_NUMBER_MISMATCH
    modelMISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression assertNotNull(sampler) is a void method call, and thus it cannot be parameterized
    Expression model.startProxy() 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 model.startProxy() is a void method call, and thus it cannot be parameterized
    5
    model.startProxy();
    24
    assertEquals("Counter: " + counter, order[counter], sampler.getName());
    24
    assertEquals("Counter: " + counter, order[counter], sampler.getName());
    8
    restart.setEnabled(false);
    Differences
    Expression1Expression2Difference
    assertEqualssetEnabledMETHOD_INVOCATION_NAME_MISMATCH
    assertEquals("Counter: " + counter,order[counter],sampler.getName())restart.setEnabled(false)ARGUMENT_NUMBER_MISMATCH
    restartMISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression assertEquals("Counter: " + counter,order[counter],sampler.getName()) is a void method call, and thus it cannot be parameterized
    Expression restart.setEnabled(false) 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 restart.setEnabled(false) is a void method call, and thus it cannot be parameterized
    8
    restart.setEnabled(false);
    Precondition Violations (9)
    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
    2Expression assertNotNull(sampler) is a void method call, and thus it cannot be parameterized
    3Expression model.startProxy() is a void method call, and thus it cannot be parameterized
    4Expression assertNotNull(sampler) is a void method call, and thus it cannot be parameterized
    5Expression model.startProxy() is a void method call, and thus it cannot be parameterized
    6Expression assertEquals("Counter: " + counter,order[counter],sampler.getName()) is a void method call, and thus it cannot be parameterized
    7Expression restart.setEnabled(false) is a void method call, and thus it cannot be parameterized
    8Expression assertEquals("Counter: " + counter,order[counter],sampler.getName()) is a void method call, and thus it cannot be parameterized
    9Expression restart.setEnabled(false) is a void method call, and thus it cannot be parameterized