EObject eObject = (EObject)featureMapEntry.getValue(); if (eObject != null && (eObject.eContainer() != container || eObject.eContainmentFeature() != featureMapEntryFeature)) { containmentInformation.put(eObject, new OldContainmentInformation(container, (EReference)featureMapEntryFeature)); }
EObject eObject = (EObject)featureChange.getValue(); if (eObject != null && (eObject.eContainer() != container || eObject.eContainmentFeature() != feature)) { containmentInformation.put(eObject, new OldContainmentInformation(container, (EReference)feature)); }
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: Map getOldContainmentInformation() Method name: Map getOldContainmentInformation()
Number of AST nodes: 3 Number of AST nodes: 3
1
EObject eObject = (EObject)featureMapEntry.getValue();
1
EObject eObject = (EObject)featureChange.getValue();
2
                if (eObject != null && (eObject.eContainer() != container || eObject.eContainmentFeature() != featureMapEntryFeature))
2
              if (eObject != null && (eObject.eContainer() != container || eObject.eContainmentFeature() != feature))
3
                {
3
              
4
  
4
{
5
                containmentInformation.put(eObject, new OldContainmentInformation(container, (EReference)featureMapEntryFeature));
5
                containmentInformation.put(eObject, new OldContainmentInformation(container, (EReference)feature));
6
                }
6
              }
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.4
Clones locationClones are in the same method
Number of node comparisons11
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    13
    EObject eObject = (EObject)featureMapEntry.getValue();
    13
    EObject eObject = (EObject)featureMapEntry.getValue();
    23
    EObject eObject = (EObject)featureChange.getValue();
    Differences
    Expression1Expression2Difference
    featureMapEntryfeatureChangeVARIABLE_NAME_MISMATCH
    org.eclipse.emf.ecore.util.FeatureMap.Entryorg.eclipse.emf.ecore.change.FeatureChangeVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.ecore.util.FeatureMap.Entry of variable featureMapEntry does not match with type org.eclipse.emf.ecore.change.FeatureChange of variable featureChange
    • Make classes org.eclipse.emf.ecore.util.FeatureMap.Entry and org.eclipse.emf.ecore.change.FeatureChange extend a common superclass
    23
    EObject eObject = (EObject)featureChange.getValue();
    14
    if (eObject != null && (eObject.eContainer() != container || eObject.eContainmentFeature() != featureMapEntryFeature))
    14
    if (eObject != null && (eObject.eContainer() != container || eObject.eContainmentFeature() != featureMapEntryFeature))
    24
    if (eObject != null && (eObject.eContainer() != container || eObject.eContainmentFeature() != feature))
    Differences
    Expression1Expression2Difference
    featureMapEntryFeaturefeatureVARIABLE_NAME_MISMATCH
    24
    if (eObject != null && (eObject.eContainer() != container || eObject.eContainmentFeature() != feature))
    15
    containmentInformation.put(eObject, new OldContainmentInformation(container, (EReference)featureMapEntryFeature));
    15
    containmentInformation.put(eObject, new OldContainmentInformation(container, (EReference)featureMapEntryFeature));
    25
    containmentInformation.put(eObject, new OldContainmentInformation(container, (EReference)feature));
    Differences
    Expression1Expression2Difference
    featureMapEntryFeaturefeatureVARIABLE_NAME_MISMATCH
    25
    containmentInformation.put(eObject, new OldContainmentInformation(container, (EReference)feature));
    Precondition Violations (1)
    Row Violation
    1Type org.eclipse.emf.ecore.util.FeatureMap.Entry of variable featureMapEntry does not match with type org.eclipse.emf.ecore.change.FeatureChange of variable featureChange