if (isPessimistic) { super.undo(); } else if (!commandList.isEmpty()) { Command command = commandList.get(commandList.size() - 1); command.undo(); }
if (isPessimistic) { super.redo(); } else if (!commandList.isEmpty()) { Command command = commandList.get(commandList.size() - 1); command.redo(); }
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/common/command/StrictCompoundCommand.java File path: /emf-2.4.1/src/org/eclipse/emf/common/command/StrictCompoundCommand.java
Method name: void undo() Method name: void redo()
Number of AST nodes: 5 Number of AST nodes: 5
1
if (isPessimistic)
1
if (isPessimistic)
2
    {
2
    {
3
      super.undo();
3
      super.redo();
4
    }
4
    }
5
    else if (!commandList.isEmpty())
5
    else if (!commandList.isEmpty())
6
    {
6
    {
7
      Command command = commandList.get(commandList.size() - 1);
7
      Command command = commandList.get(commandList.size() - 1);
8
      command.undo();
8
      command.redo();
9
    }
9
    }
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.3
Clones locationClones are declared in the same class
Number of node comparisons20
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    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.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (isPessimistic)
    1
    if (isPessimistic)
    2
    super.undo();
    2
    super.undo();
    2
    super.redo();
    Differences
    Expression1Expression2Difference
    undoredoMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression super.undo() is a void method call, and thus it cannot be parameterized
    Expression super.redo() is a void method call, and thus it cannot be parameterized
    2
    super.redo();
    3
    else if (!commandList.isEmpty())
    3
    else if (!commandList.isEmpty())
    4
    Command command = commandList.get(commandList.size() - 1);
    4
    Command command = commandList.get(commandList.size() - 1);
    5
    command.undo();
    5
    command.undo();
    5
    command.redo();
    Differences
    Expression1Expression2Difference
    undoredoMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression command.undo() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression command.redo() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression command.undo() is a void method call, and thus it cannot be parameterized
    Expression command.redo() is a void method call, and thus it cannot be parameterized
    5
    command.redo();
    Precondition Violations (6)
    Row Violation
    1Expression super.undo() is a void method call, and thus it cannot be parameterized
    2Expression super.redo() is a void method call, and thus it cannot be parameterized
    3Expression command.undo() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression command.redo() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression command.undo() is a void method call, and thus it cannot be parameterized
    6Expression command.redo() is a void method call, and thus it cannot be parameterized