if (dragCommand.canExecute()) { dragCommand.execute(); dropCommand = AddCommand.create(domain, optimizedDropCommandOwner, null, dragCommand.getResult()); } else { // Thread.dumpStack(); }
if (command.canExecute()) { command.execute(); } else { // Thread.dumpStack(); }
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/edit/command/DragAndDropCommand.java File path: /emf-2.4.1/src/org/eclipse/emf/edit/command/PasteFromClipboardCommand.java
Method name: void execute() Method name: void doExecute()
Number of AST nodes: 3 Number of AST nodes: 2
1
if (dragCommand.canExecute()) 
1
if (command.canExecute())
2
   
3
     {
2
    {
4
          dragCommand.execute();
3
      command.execute();
5
          dropCommand = AddCommand.create(domain, optimizedDropCommandOwner, null, dragCommand.getResult());
4
    
6
        }
7
    
5
}  
8
    else 
6
    else
9
 
10
       {
7
    
11
    
8
{
12
      // Thread.dumpStack();
9
      // Thread.dumpStack();
13
        }
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 comparisons6
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.5
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    3
    if (dragCommand.canExecute())
    3
    if (dragCommand.canExecute())
    1
    if (command.canExecute())
    Differences
    Expression1Expression2Difference
    dragCommandcommandVARIABLE_NAME_MISMATCH
    org.eclipse.emf.common.command.Commandorg.eclipse.emf.common.command.StrictCompoundCommandVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.common.command.Command of variable dragCommand does not match with type org.eclipse.emf.common.command.StrictCompoundCommand of variable command
    • Make classes org.eclipse.emf.common.command.Command and org.eclipse.emf.common.command.StrictCompoundCommand extend a common superclass
    1
    if (command.canExecute())
    4
    dragCommand.execute();
    4
    dragCommand.execute();
    2
    command.execute();
    Differences
    Expression1Expression2Difference
    dragCommandcommandVARIABLE_NAME_MISMATCH
    org.eclipse.emf.common.command.Commandorg.eclipse.emf.common.command.StrictCompoundCommandVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.common.command.Command of variable dragCommand does not match with type org.eclipse.emf.common.command.StrictCompoundCommand of variable command
    • Make classes org.eclipse.emf.common.command.Command and org.eclipse.emf.common.command.StrictCompoundCommand extend a common superclass
    2
    command.execute();
    5
    dropCommand = AddCommand.create(domain, optimizedDropCommandOwner, null, dragCommand.getResult());
                                                                                                                                                                                                    
    Precondition Violations (2)
    Row Violation
    1Type org.eclipse.emf.common.command.Command of variable dragCommand does not match with type org.eclipse.emf.common.command.StrictCompoundCommand of variable command
    2Type org.eclipse.emf.common.command.Command of variable dragCommand does not match with type org.eclipse.emf.common.command.StrictCompoundCommand of variable command