if (subcommand != null) { subcommand.dispose(); } super.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/mapping/command/RemoveMappingCommand.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: 3 Number of AST nodes: 4
1
if (subcommand != null)
1
if (commands != null)
2
    {
2
    
3
      subcommand.dispose();
4
    }
5
    super.dispose
3
        {
4
              commands.redo();
5
            }
6
            super.redo();
6
();
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 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 fragment2
    Time elapsed for statement mapping (ms)0.5
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    if (subcommand != null)
    1
    if (subcommand != null)
    1
    if (commands != null)
    Differences
    Expression1Expression2Difference
    subcommandcommandsVARIABLE_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 subcommand 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
    subcommand.dispose();
                                                    
    3
    super.dispose();
    3
    super.dispose();
    3
    super.redo();
    Differences
    Expression1Expression2Difference
    disposeredoMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression super.dispose() 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
    3
    super.redo();
                                    
    4
    deregister();
    Precondition Violations (3)
    Row Violation
    1Type org.eclipse.emf.common.command.Command of variable subcommand does not match with type org.eclipse.emf.common.command.CompoundCommand of variable commands
    2Expression super.dispose() is a void method call, and thus it cannot be parameterized
    3Expression super.redo() is a void method call, and thus it cannot be parameterized