EStructuralFeature.Internal feature = (EStructuralFeature.Internal)eClass().getEStructuralFeature(featureID); if (feature.isMany()) { return featureMap.basicAdd(feature, otherEnd, notifications); } else if (feature instanceof EReference && ((EReference)feature).isContainer()) { return eSettingDelegate(feature).dynamicInverseAdd(this, null, -1, otherEnd, notifications); } else { InternalEObject oldValue = (InternalEObject)eDynamicGet(feature, false); if (oldValue != null) { notifications = oldValue.eInverseRemove (this, oldValue.eClass().getFeatureID(((EReference)feature).getEOpposite()), null, notifications); notifications = featureMap.basicRemove(feature, oldValue, notifications); } return featureMap.basicAdd(feature, otherEnd, notifications); }
EStructuralFeature.Internal feature = (EStructuralFeature.Internal)eClass().getEStructuralFeature(featureID); if (feature.isMany()) { return featureMap.basicAdd(feature, otherEnd, notifications); } else if (feature instanceof EReference && ((EReference)feature).isContainer()) { return eSettingDelegate(feature).dynamicInverseAdd(this, null, -1, otherEnd, notifications); } else { InternalEObject oldValue = (InternalEObject)eDynamicGet(feature, false); if (oldValue != null) { notifications = oldValue.eInverseRemove (this, oldValue.eClass().getFeatureID(((EReference)feature).getEOpposite()), null, notifications); notifications = featureMap.basicRemove(feature, oldValue, notifications); } return featureMap.basicAdd(feature, otherEnd, notifications); }
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/BasicFeatureMap.java File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/DelegatingFeatureMap.java
Method name: NotificationChain eDynamicInverseAdd(InternalEObject, int, Class, NotificationChain) Method name: NotificationChain eDynamicInverseAdd(InternalEObject, int, Class, NotificationChain)
Number of AST nodes: 10 Number of AST nodes: 10
1
EStructuralFeature.Internal feature = (EStructuralFeature.Internal)eClass().getEStructuralFeature(featureID);
1
EStructuralFeature.Internal feature = (EStructuralFeature.Internal)eClass().getEStructuralFeature(featureID);
2
      if (feature.isMany())
2
      if (feature.isMany())
3
      {
3
      {
4
        return featureMap.basicAdd(feature, otherEnd, notifications);
4
        return featureMap.basicAdd(feature, otherEnd, notifications);
5
      }
5
      }
6
      else if (feature instanceof EReference && ((EReference)feature).isContainer())
6
      else if (feature instanceof EReference && ((EReference)feature).isContainer())
7
      {
7
      {
8
        return eSettingDelegate(feature).dynamicInverseAdd(this, null, -1, otherEnd, notifications);
8
        return eSettingDelegate(feature).dynamicInverseAdd(this, null, -1, otherEnd, notifications);
9
      }
9
      }
10
      else
10
      else
11
      {
11
      {
12
        InternalEObject oldValue = (InternalEObject)eDynamicGet(feature, false);
12
        InternalEObject oldValue = (InternalEObject)eDynamicGet(feature, false);
13
        if (oldValue != null)
13
        if (oldValue != null)
14
        {
14
        {
15
          notifications = oldValue.eInverseRemove
15
          notifications = oldValue.eInverseRemove
16
            (this, oldValue.eClass().getFeatureID(((EReference)feature).getEOpposite()), null, notifications);
16
            (this, oldValue.eClass().getFeatureID(((EReference)feature).getEOpposite()), null, notifications);
17
          notifications = featureMap.basicRemove(feature, oldValue, notifications);
17
          notifications = featureMap.basicRemove(feature, oldValue, notifications);
18
        }
18
        }
19
        return featureMap.basicAdd(feature, otherEnd, notifications);
19
        return featureMap.basicAdd(feature, otherEnd, notifications);
20
      }
20
      }
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 different classes having the same super class
Number of node comparisons39
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements10
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)40.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    EStructuralFeature.Internal feature = (EStructuralFeature.Internal)eClass().getEStructuralFeature(featureID);
    1
    EStructuralFeature.Internal feature = (EStructuralFeature.Internal)eClass().getEStructuralFeature(featureID);
    2
    if (feature.isMany())
    2
    if (feature.isMany())
    3
    return featureMap.basicAdd(feature, otherEnd, notifications);
    3
    return featureMap.basicAdd(feature, otherEnd, notifications);
    3
    return featureMap.basicAdd(feature, otherEnd, notifications);
    Differences
    Expression1Expression2Difference
    org.eclipse.emf.ecore.util.BasicFeatureMaporg.eclipse.emf.ecore.util.DelegatingFeatureMapSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression featureMap cannot be unified with expression featureMap , because common superclass java.util.AbstractList<org.eclipse.emf.ecore.util.FeatureMap.Entry> does not declare member(s) public org.eclipse.emf.common.notify.NotificationChain basicAdd(org.eclipse.emf.ecore.EStructuralFeature, java.lang.Object, org.eclipse.emf.common.notify.NotificationChain)
    3
    return featureMap.basicAdd(feature, otherEnd, notifications);
    4
    else if (feature instanceof EReference && ((EReference)feature).isContainer())
    4
    else if (feature instanceof EReference && ((EReference)feature).isContainer())
    5
    return eSettingDelegate(feature).dynamicInverseAdd(this, null, -1, otherEnd, notifications);
    5
    return eSettingDelegate(feature).dynamicInverseAdd(this, null, -1, otherEnd, notifications);
    else
    else
    6
    InternalEObject oldValue = (InternalEObject)eDynamicGet(feature, false);
    6
    InternalEObject oldValue = (InternalEObject)eDynamicGet(feature, false);
    7
    if (oldValue != null)
    7
    if (oldValue != null)
    8
    notifications = oldValue.eInverseRemove(this, oldValue.eClass().getFeatureID(((EReference)feature).getEOpposite()), null, notifications);
    8
    notifications = oldValue.eInverseRemove(this, oldValue.eClass().getFeatureID(((EReference)feature).getEOpposite()), null, notifications);
    9
    notifications = featureMap.basicRemove(feature, oldValue, notifications);
    9
    notifications = featureMap.basicRemove(feature, oldValue, notifications);
    9
    notifications = featureMap.basicRemove(feature, oldValue, notifications);
    Differences
    Expression1Expression2Difference
    org.eclipse.emf.ecore.util.BasicFeatureMaporg.eclipse.emf.ecore.util.DelegatingFeatureMapSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression featureMap cannot be unified with expression featureMap , because common superclass java.util.AbstractList<org.eclipse.emf.ecore.util.FeatureMap.Entry> does not declare member(s) public org.eclipse.emf.common.notify.NotificationChain basicRemove(org.eclipse.emf.ecore.EStructuralFeature, java.lang.Object, org.eclipse.emf.common.notify.NotificationChain)
    9
    notifications = featureMap.basicRemove(feature, oldValue, notifications);
    10
    return featureMap.basicAdd(feature, otherEnd, notifications);
    10
    return featureMap.basicAdd(feature, otherEnd, notifications);
    10
    return featureMap.basicAdd(feature, otherEnd, notifications);
    Differences
    Expression1Expression2Difference
    org.eclipse.emf.ecore.util.BasicFeatureMaporg.eclipse.emf.ecore.util.DelegatingFeatureMapSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression featureMap cannot be unified with expression featureMap , because common superclass java.util.AbstractList<org.eclipse.emf.ecore.util.FeatureMap.Entry> does not declare member(s) public org.eclipse.emf.common.notify.NotificationChain basicAdd(org.eclipse.emf.ecore.EStructuralFeature, java.lang.Object, org.eclipse.emf.common.notify.NotificationChain)
    10
    return featureMap.basicAdd(feature, otherEnd, notifications);
    Precondition Violations (3)
    Row Violation
    1Expression featureMap cannot be unified with expression featureMap , because common superclass java.util.AbstractList<org.eclipse.emf.ecore.util.FeatureMap.Entry> does not declare member(s) public org.eclipse.emf.common.notify.NotificationChain basicAdd(org.eclipse.emf.ecore.EStructuralFeature, java.lang.Object, org.eclipse.emf.common.notify.NotificationChain)
    2Expression featureMap cannot be unified with expression featureMap , because common superclass java.util.AbstractList<org.eclipse.emf.ecore.util.FeatureMap.Entry> does not declare member(s) public org.eclipse.emf.common.notify.NotificationChain basicRemove(org.eclipse.emf.ecore.EStructuralFeature, java.lang.Object, org.eclipse.emf.common.notify.NotificationChain)
    3Expression featureMap cannot be unified with expression featureMap , because common superclass java.util.AbstractList<org.eclipse.emf.ecore.util.FeatureMap.Entry> does not declare member(s) public org.eclipse.emf.common.notify.NotificationChain basicAdd(org.eclipse.emf.ecore.EStructuralFeature, java.lang.Object, org.eclipse.emf.common.notify.NotificationChain)