if (command != null) { command.dispose(); }
if (commands != null) { commands.redo(); } super.redo(); deregister();
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/common/command/CommandWrapper.java File path: /emf-2.4.1/src/org/eclipse/emf/mapping/provider/MappingItemProvider.java
Method name: void dispose() Method name: void redo()
Number of AST nodes: 2 Number of AST nodes: 4
1
if (command != null)
1
if (commands != null)
2
    {
2
    
3
      command.dispose
3
        {
4
              commands.redo();
5
            }
4
();
6
            super.redo();
5
    }
7
            deregister();
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 statements1
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment3
    Time elapsed for statement mapping (ms)0.3
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    if (command != null)
    1
    if (command != null)
    1
    if (commands != null)
    Differences
    Expression1Expression2Difference
    commandcommandsVARIABLE_NAME_MISMATCH
    org.eclipse.emf.common.command.Commandorg.eclipse.emf.common.command.CompoundCommandVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.common.command.Command of variable command does not match with type org.eclipse.emf.common.command.CompoundCommand of variable commands
    • Make classes org.eclipse.emf.common.command.Command and org.eclipse.emf.common.command.CompoundCommand extend a common superclass
    1
    if (commands != null)
                                          
    2
    commands.redo();
    2
    command.dispose();
                                              
                                    
    3
    super.redo();
                                    
    4
    deregister();
    Precondition Violations (1)
    Row Violation
    1Type org.eclipse.emf.common.command.Command of variable command does not match with type org.eclipse.emf.common.command.CompoundCommand of variable commands