for (IMocksControl control : mockControls) { control.reset(); }
for (IMocksControl control : mockControls) { control.replay(); }
Clone fragments detected by clone detection tool
File path: /sql12/test/src/utils/EasyMockHelper.java File path: /sql12/test/src/utils/EasyMockHelper.java
Method name: void resetAll() Method name: void replayAll()
Number of AST nodes: 2 Number of AST nodes: 2
1
for (IMocksControl control : mockControls) {
1
for (IMocksControl control : mockControls) {
2
         control.reset();
2
         control.replay();
3
      }
3
      }
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 declared in the same class
Number of node comparisons4
  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 fragment0
    Time elapsed for statement mapping (ms)0.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    for (IMocksControl control : mockControls)
    1
    for (IMocksControl control : mockControls)
    2
    control.reset();
    2
    control.reset();
    2
    control.replay();
    Differences
    Expression1Expression2Difference
    resetreplayMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression control.reset() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression control.replay() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression control.reset() is a void method call, and thus it cannot be parameterized
    Expression control.replay() is a void method call, and thus it cannot be parameterized
    2
    control.replay();
    Precondition Violations (4)
    Row Violation
    1Expression control.reset() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression control.replay() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression control.reset() is a void method call, and thus it cannot be parameterized
    4Expression control.replay() is a void method call, and thus it cannot be parameterized