OldContainmentInformation oldContainmentInformation = getOldContainmentInformation().get(eObject); if (oldContainmentInformation == null) { return eObject.eContainer(); } else { return oldContainmentInformation.container; }
OldContainmentInformation oldContainmentInformation = getOldContainmentInformation().get(eObject); if (oldContainmentInformation == null) { return eObject.eContainmentFeature(); } else { return oldContainmentInformation.containmentFeature; }
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/change/impl/ChangeDescriptionImpl.java File path: /emf-2.4.1/src/org/eclipse/emf/ecore/change/impl/ChangeDescriptionImpl.java
Method name: EObject getOldContainer(EObject) Method name: EReference getOldContainmentFeature(EObject)
Number of AST nodes: 4 Number of AST nodes: 4
1
OldContainmentInformation oldContainmentInformation = getOldContainmentInformation().get(eObject);
1
OldContainmentInformation oldContainmentInformation = getOldContainmentInformation().get(eObject);
2
    if (oldContainmentInformation == null)
2
    if (oldContainmentInformation == null)
3
    {
3
    {
4
      return eObject.eContainer();
4
      return eObject.eContainmentFeature();
5
    }
5
    }
6
    else
6
    else
7
    {
7
    {
8
      return oldContainmentInformation.container;
8
      return oldContainmentInformation.containmentFeature;
9
    }
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.3
Clones locationClones are declared in the same class
Number of node comparisons10
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)1.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    OldContainmentInformation oldContainmentInformation = getOldContainmentInformation().get(eObject);
    1
    OldContainmentInformation oldContainmentInformation = getOldContainmentInformation().get(eObject);
    2
    if (oldContainmentInformation == null)
    2
    if (oldContainmentInformation == null)
                                                                                    
    3
    return eObject.eContainmentFeature();
    Preondition Violations
    Unmatched return eObject.eContainmentFeature();
    3
    return eObject.eContainmentFeature();
    3
    return eObject.eContainer();
    3
    return eObject.eContainer();
    Preondition Violations
    Unmatched return eObject.eContainer();
                                                                  
    else
            
                                                                                                                  
    4
    return oldContainmentInformation.containmentFeature;
    Preondition Violations
    Unmatched statement return oldContainmentInformation.containmentFeature; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched return oldContainmentInformation.containmentFeature;
    4
    return oldContainmentInformation.containmentFeature;
    4
    return oldContainmentInformation.container;
    4
    return oldContainmentInformation.container;
    Preondition Violations
    Unmatched statement return oldContainmentInformation.container; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched return oldContainmentInformation.container;
                                                                                                
    Precondition Violations (6)
    Row Violation
    1Unmatched return eObject.eContainmentFeature();
    2Unmatched return eObject.eContainer();
    3Unmatched statement return oldContainmentInformation.containmentFeature; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    4Unmatched return oldContainmentInformation.containmentFeature;
    5Unmatched statement return oldContainmentInformation.container; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    6Unmatched return oldContainmentInformation.container;