for (EObject child : object.eContents()) { addCreateCopyCommands(compoundCommand, child); }
for (EObject child : eObject.eContents()) { validate(child); } return this;
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/edit/command/CopyCommand.java File path: /emf-2.4.1/src/org/eclipse/emf/importer/rose/builder/RoseEcoreBuilder.java
Method name: void addCreateCopyCommands(CompoundCommand, EObject) Method name: Object defaultCase(EObject)
Number of AST nodes: 2 Number of AST nodes: 3
1
for (EObject child : object.eContents())
1
for (EObject child : eObject.eContents())
2
      {
2
      
3
        addCreateCopyCommands(compoundCommand, child);
4
      }
3
    {
4
            validate(child);
5
          }
6
          return this;
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
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 fragment1
    Time elapsed for statement mapping (ms)380.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    6
    for (EObject child : object.eContents())
    6
    for (EObject child : object.eContents())
    1
    for (EObject child : eObject.eContents())
    Differences
    Expression1Expression2Difference
    objecteObjectVARIABLE_NAME_MISMATCH
    1
    for (EObject child : eObject.eContents())
    7
    addCreateCopyCommands(compoundCommand, child);
    7
    addCreateCopyCommands(compoundCommand, child);
    2
    validate(child);
    Differences
    Expression1Expression2Difference
    addCreateCopyCommandsvalidateMETHOD_INVOCATION_NAME_MISMATCH
    addCreateCopyCommands(compoundCommand,child)validate(child)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression addCreateCopyCommands(compoundCommand,child) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression validate(child) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression addCreateCopyCommands(compoundCommand,child) is a void method call, and thus it cannot be parameterized
    Expression validate(child) is a void method call, and thus it cannot be parameterized
    Expression addCreateCopyCommands(compoundCommand,child) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression validate(child) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression addCreateCopyCommands(compoundCommand,child) is a void method call, and thus it cannot be parameterized
    Expression validate(child) is a void method call, and thus it cannot be parameterized
    2
    validate(child);
                                  
    3
    return this;
    Preondition Violations
    Unmatched return this;
    3
    return this;
    Precondition Violations (9)
    Row Violation
    1Expression addCreateCopyCommands(compoundCommand,child) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression validate(child) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression addCreateCopyCommands(compoundCommand,child) is a void method call, and thus it cannot be parameterized
    4Expression validate(child) is a void method call, and thus it cannot be parameterized
    5Expression addCreateCopyCommands(compoundCommand,child) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression validate(child) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression addCreateCopyCommands(compoundCommand,child) is a void method call, and thus it cannot be parameterized
    8Expression validate(child) is a void method call, and thus it cannot be parameterized
    9Unmatched return this;