if (getClearEachIteration()) { clearCache(); }
if (isFirst()) { fireIterationStart(); first = false; // TODO - should this use setFirst() ? }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/http/control/CacheManager.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/control/GenericController.java
Method name: void testIterationStart(LoopIterationEvent) Method name: void fireIterEvents()
Number of AST nodes: 2 Number of AST nodes: 3
1
if (getClearEachIteration()) {
1
if (
2
		    clearCache();
2
isFirst()) {
3
			fireIterationStart();
4
			first = false; // TODO - should this use setFirst() ?
3
		}
5
		}
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
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 comparisons6
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)1.3
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    if (getClearEachIteration())
    1
    if (getClearEachIteration())
    1
    if (isFirst())
    Differences
    Expression1Expression2Difference
    getClearEachIterationisFirstMETHOD_INVOCATION_NAME_MISMATCH
    1
    if (isFirst())
    2
    clearCache();
    2
    clearCache();
    2
    fireIterationStart();
    Differences
    Expression1Expression2Difference
    clearCachefireIterationStartMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression clearCache() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method clearCache
    Expression clearCache() is a void method call, and thus it cannot be parameterized
    Expression fireIterationStart() is a void method call, and thus it cannot be parameterized
    2
    fireIterationStart();
                                  
    3
    first = false;
    Preondition Violations
    Unmatched statement first=false; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    3
    first = false;
    Precondition Violations (4)
    Row Violation
    1Expression clearCache() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression clearCache() is a void method call, and thus it cannot be parameterized
    3Expression fireIterationStart() is a void method call, and thus it cannot be parameterized
    4Unmatched statement first=false; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted