for (Object object : collection) { Mapping mapping = (Mapping)object; domain.getMappingRoot().deregister(mapping); } subcommand.redo();
for (Object object : collection) { Mapping mapping = (Mapping)object; domain.getMappingRoot().deregister(mapping); } subcommand.undo();
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/mapping/command/RemoveMappingCommand.java File path: /emf-2.4.1/src/org/eclipse/emf/mapping/command/AddMappingCommand.java
Method name: void redo() Method name: void undo()
Number of AST nodes: 4 Number of AST nodes: 4
1
for (Object object : collection)
1
for (Object object : collection)
2
    {
2
    {
3
      Mapping mapping = (Mapping)object;
3
      Mapping mapping = (Mapping)object;
4
      domain.getMappingRoot().deregister(mapping);
4
      domain.getMappingRoot().deregister(mapping);
5
    }
5
    }
6
    subcommand.redo();
6
    subcommand.undo();
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 comparisons10
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)3620.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    for (Object object : collection)
    1
    for (Object object : collection)
    2
    Mapping mapping = (Mapping)object;
    2
    Mapping mapping = (Mapping)object;
    3
    domain.getMappingRoot().deregister(mapping);
    3
    domain.getMappingRoot().deregister(mapping);
    4
    subcommand.redo();
    4
    subcommand.redo();
    4
    subcommand.undo();
    Differences
    Expression1Expression2Difference
    redoundoMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression subcommand.redo() is a void method call, and thus it cannot be parameterized
    Expression subcommand.undo() is a void method call, and thus it cannot be parameterized
    4
    subcommand.undo();
    Precondition Violations (2)
    Row Violation
    1Expression subcommand.redo() is a void method call, and thus it cannot be parameterized
    2Expression subcommand.undo() is a void method call, and thus it cannot be parameterized