for (Command childCommand : commandList) { addOwners(childCommand); }
for (Command command : commandList) { command.dispose(); }
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/edit/provider/ItemProviderAdapter.java File path: /emf-2.4.1/src/org/eclipse/emf/common/command/CompoundCommand.java
Method name: void addOwners(Command) Method name: void dispose()
Number of AST nodes: 2 Number of AST nodes: 2
1
for (Command childCommand : commandList)
1
for (Command command : commandList)
2
          {
2
    {
3
            addOwners(childCommand);
3
      
4
      
4
command.dispose();
5
    }
5
    }
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 comparisons4
  1. {Non-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)308.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    8
    for (Command childCommand : commandList)
    8
    for (Command childCommand : commandList)
    1
    for (Command command : commandList)
    Differences
    Expression1Expression2Difference
    childCommandcommandVARIABLE_NAME_MISMATCH
    1
    for (Command command : commandList)
    9
    addOwners(childCommand);
    9
    addOwners(childCommand);
    2
    command.dispose();
    Differences
    Expression1Expression2Difference
    addOwnersdisposeMETHOD_INVOCATION_NAME_MISMATCH
    addOwners(childCommand)command.dispose()ARGUMENT_NUMBER_MISMATCH
    commandMISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression addOwners(childCommand) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression command.dispose() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression addOwners(childCommand) is a void method call, and thus it cannot be parameterized
    Expression command.dispose() is a void method call, and thus it cannot be parameterized
    Expression addOwners(childCommand) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression command.dispose() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression addOwners(childCommand) is a void method call, and thus it cannot be parameterized
    Expression command.dispose() is a void method call, and thus it cannot be parameterized
    2
    command.dispose();
    Precondition Violations (8)
    Row Violation
    1Expression addOwners(childCommand) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression command.dispose() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression addOwners(childCommand) is a void method call, and thus it cannot be parameterized
    4Expression command.dispose() is a void method call, and thus it cannot be parameterized
    5Expression addOwners(childCommand) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression command.dispose() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression addOwners(childCommand) is a void method call, and thus it cannot be parameterized
    8Expression command.dispose() is a void method call, and thus it cannot be parameterized