for (EObject child : object.eContents()) { addCreateCopyCommands(compoundCommand, child); }
for (EObject child : eObject.eContents()) { setIDs(eObject, 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);
3
        
4
      }
4
    setIDs(eObject, 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 statements1
    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.4
    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())
                                                      
    2
    setIDs(eObject, child);
    Preondition Violations
    Unmatched statement setIDs(eObject,child); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2
    setIDs(eObject, child);
    7
    addCreateCopyCommands(compoundCommand, child);
    7
    addCreateCopyCommands(compoundCommand, child);
    Preondition Violations
    Unmatched statement addCreateCopyCommands(compoundCommand,child); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                    
                                  
    3
    return this;
    Preondition Violations
    Unmatched return this;
    3
    return this;
    Precondition Violations (3)
    Row Violation
    1Unmatched statement setIDs(eObject,child); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement addCreateCopyCommands(compoundCommand,child); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Unmatched return this;