if (command.canExecute()) { command.execute(); } else { // Thread.dumpStack(); }
if (dropCommand.canExecute()) { dropCommand.execute(); } else { // Thread.dumpStack(); }
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/edit/command/PasteFromClipboardCommand.java File path: /emf-2.4.1/src/org/eclipse/emf/edit/command/DragAndDropCommand.java
Method name: void doExecute() Method name: void execute()
Number of AST nodes: 2 Number of AST nodes: 2
1
if (command.canExecute())
1
if (dropCommand.canExecute()) 
2
    {
2
      {
3
      command.execute();
3
        dropCommand.execute();
4
    }  
4
      
5
}
5
    else
6
      else
7
 
6
    {
8
      {
7
      // Thread.dumpStack();
9
        // Thread.dumpStack();
8
    }
10
      }
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)0.3
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (command.canExecute())
    1
    if (command.canExecute())
    8
    if (dropCommand.canExecute())
    Differences
    Expression1Expression2Difference
    commanddropCommandVARIABLE_NAME_MISMATCH
    org.eclipse.emf.common.command.StrictCompoundCommandorg.eclipse.emf.common.command.CommandVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.common.command.StrictCompoundCommand of variable command does not match with type org.eclipse.emf.common.command.Command of variable dropCommand
    • Make classes org.eclipse.emf.common.command.StrictCompoundCommand and org.eclipse.emf.common.command.Command extend a common superclass
    8
    if (dropCommand.canExecute())
    2
    command.execute();
    2
    command.execute();
    9
    dropCommand.execute();
    Differences
    Expression1Expression2Difference
    commanddropCommandVARIABLE_NAME_MISMATCH
    org.eclipse.emf.common.command.StrictCompoundCommandorg.eclipse.emf.common.command.CommandVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.common.command.StrictCompoundCommand of variable command does not match with type org.eclipse.emf.common.command.Command of variable dropCommand
    • Make classes org.eclipse.emf.common.command.StrictCompoundCommand and org.eclipse.emf.common.command.Command extend a common superclass
    9
    dropCommand.execute();
    Precondition Violations (2)
    Row Violation
    1Type org.eclipse.emf.common.command.StrictCompoundCommand of variable command does not match with type org.eclipse.emf.common.command.Command of variable dropCommand
    2Type org.eclipse.emf.common.command.StrictCompoundCommand of variable command does not match with type org.eclipse.emf.common.command.Command of variable dropCommand