reInitialize(); if (endOfLoop()) { resetLoopCount(); return null; } return next();
reInitialize(); if (endOfArguments()) { // setDone(true); resetLoopCount(); return null; } return next();
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/control/RunTime.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/control/ForeachController.java
Method name: Sampler nextIsNull() Method name: Sampler nextIsNull()
Number of AST nodes: 5 Number of AST nodes: 5
1
reInitialize();
1
reInitialize();
2
		if (endOfLoop()) {
2
		if (endOfArguments()) {
3
			// setDone(true);
3
			resetLoopCount();
4
			resetLoopCount();
4
			return null;
5
			return null;
5
		}
6
		}
6
		return next();
7
		return next();
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 having the same super class
Number of node comparisons13
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    reInitialize();
    1
    reInitialize();
    2
    if (endOfLoop())
    2
    if (endOfLoop())
    2
    if (endOfArguments())
    Differences
    Expression1Expression2Difference
    endOfLoopendOfArgumentsMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression endOfArguments() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method endOfArguments
    2
    if (endOfArguments())
    3
    resetLoopCount();
    3
    resetLoopCount();
    4
    return null;
    4
    return null;
    5
    return next();
    5
    return next();
    Precondition Violations (1)
    Row Violation
    1Expression endOfArguments() cannot be parameterized, because it has dependencies to/from statements that will be extracted