if (dragCommand.canExecute()) { dragCommand.execute(); dropCommand = AddCommand.create(domain, optimizedDropCommandOwner, null, dragCommand.getResult()); } else { // Thread.dumpStack(); }
if (super.canExecute()) { super.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/CopyCommand.java
Method name: void execute() Method name: void execute()
Number of AST nodes: 3 Number of AST nodes: 2
1
if (dragCommand.canExecute()) 
1
if (super.canExecute())
2
 
3
       {
2
    
4
          dragCommand.execute();
5
          dropCommand = AddCommand.create(domain, optimizedDropCommandOwner, null, dragCommand.getResult());
6
        }
7
  
3
{
4
      super.execute();
5
    }
8
      else 
6
    else
9
        {
10
    
7
    {
11
      // Thread.dumpStack();
8
      // Thread.dumpStack();
12
        }
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.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)13034.7
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    3
    if (dragCommand.canExecute())
    3
    if (dragCommand.canExecute())
    1
    if (super.canExecute())
    Differences
    Expression1Expression2Difference
    dragCommand.canExecute()super.canExecute()TYPE_COMPATIBLE_REPLACEMENT
    1
    if (super.canExecute())
    4
    dragCommand.execute();
    4
    dragCommand.execute();
    2
    super.execute();
    Differences
    Expression1Expression2Difference
    dragCommand.execute()super.execute()TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression dragCommand.execute() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression dragCommand.execute() is a void method call, and thus it cannot be parameterized
    Expression super.execute() is a void method call, and thus it cannot be parameterized
    2
    super.execute();
    5
    dropCommand = AddCommand.create(domain, optimizedDropCommandOwner, null, dragCommand.getResult());
                                                                                                                                                                                                    
    Precondition Violations (3)
    Row Violation
    1Expression dragCommand.execute() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression dragCommand.execute() is a void method call, and thus it cannot be parameterized
    3Expression super.execute() is a void method call, and thus it cannot be parameterized