if (mapCommand != null) { mapCommand.undo(); } setCommand.doUndo();
if (mapCommand != null) { mapCommand.redo(); } removeCommand.doRedo();
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/mapping/command/SetOverrideCommand.java File path: /emf-2.4.1/src/org/eclipse/emf/mapping/command/RemoveOverrideCommand.java
Method name: void undo() Method name: void redo()
Number of AST nodes: 3 Number of AST nodes: 3
1
if (mapCommand != null)
1
if (mapCommand != null)
2
    {
2
    {
3
      mapCommand.undo();
3
      mapCommand.redo();
4
    }
4
    }
5
    setCommand.doUndo();
5
    removeCommand.doRedo();
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 comparisons5
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)4052.3
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (mapCommand != null)
    1
    if (mapCommand != null)
    2
    mapCommand.undo();
    2
    mapCommand.undo();
    2
    mapCommand.redo();
    Differences
    Expression1Expression2Difference
    undoredoMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression mapCommand.undo() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression mapCommand.redo() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression mapCommand.undo() is a void method call, and thus it cannot be parameterized
    Expression mapCommand.redo() is a void method call, and thus it cannot be parameterized
    2
    mapCommand.redo();
    3
    setCommand.doUndo();
    3
    setCommand.doUndo();
    3
    removeCommand.doRedo();
    Differences
    Expression1Expression2Difference
    doUndodoRedoMETHOD_INVOCATION_NAME_MISMATCH
    setCommandremoveCommandVARIABLE_NAME_MISMATCH
    org.eclipse.emf.edit.command.SetCommandorg.eclipse.emf.edit.command.RemoveCommandSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression setCommand.doUndo() is a void method call, and thus it cannot be parameterized
    Expression removeCommand.doRedo() is a void method call, and thus it cannot be parameterized
    3
    removeCommand.doRedo();
    Precondition Violations (6)
    Row Violation
    1Expression mapCommand.undo() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression mapCommand.redo() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression mapCommand.undo() is a void method call, and thus it cannot be parameterized
    4Expression mapCommand.redo() is a void method call, and thus it cannot be parameterized
    5Expression setCommand.doUndo() is a void method call, and thus it cannot be parameterized
    6Expression removeCommand.doRedo() is a void method call, and thus it cannot be parameterized