if (mapCommand != null) { mapCommand.undo(); } addCommand.doUndo();
if (mapCommand != null) { mapCommand.dispose(); } removeCommand.doDispose();
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/mapping/command/AddOverrideCommand.java File path: /emf-2.4.1/src/org/eclipse/emf/mapping/command/RemoveOverrideCommand.java
Method name: void undo() Method name: void dispose()
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.dispose();
4
    }
4
    }
5
    addCommand.doUndo();
5
    removeCommand.doDispose();
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)4248.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.dispose();
    Differences
    Expression1Expression2Difference
    undodisposeMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression mapCommand.undo() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression mapCommand.dispose() 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.dispose() is a void method call, and thus it cannot be parameterized
    2
    mapCommand.dispose();
    3
    addCommand.doUndo();
    3
    addCommand.doUndo();
    3
    removeCommand.doDispose();
    Differences
    Expression1Expression2Difference
    doUndodoDisposeMETHOD_INVOCATION_NAME_MISMATCH
    addCommandremoveCommandVARIABLE_NAME_MISMATCH
    org.eclipse.emf.edit.command.AddCommandorg.eclipse.emf.edit.command.RemoveCommandSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression addCommand.doUndo() is a void method call, and thus it cannot be parameterized
    Expression removeCommand.doDispose() is a void method call, and thus it cannot be parameterized
    3
    removeCommand.doDispose();
    Precondition Violations (6)
    Row Violation
    1Expression mapCommand.undo() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression mapCommand.dispose() 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.dispose() is a void method call, and thus it cannot be parameterized
    5Expression addCommand.doUndo() is a void method call, and thus it cannot be parameterized
    6Expression removeCommand.doDispose() is a void method call, and thus it cannot be parameterized