switch (featureID) { case EcorePackage.ECLASSIFIER__EANNOTATIONS: return ((InternalEList<InternalEObject>)(InternalEList<?>)getEAnnotations()).basicAdd(otherEnd, msgs); case EcorePackage.ECLASSIFIER__EPACKAGE: if (eInternalContainer() != null) msgs = eBasicRemoveFromContainer(msgs); return eBasicSetContainer(otherEnd, EcorePackage.ECLASSIFIER__EPACKAGE, msgs); } return eDynamicInverseAdd(otherEnd, featureID, msgs);
switch (featureID) { case EcorePackage.EANNOTATION__EANNOTATIONS: return ((InternalEList<InternalEObject>)(InternalEList<?>)getEAnnotations()).basicAdd(otherEnd, msgs); case EcorePackage.EANNOTATION__EMODEL_ELEMENT: if (eInternalContainer() != null) msgs = eBasicRemoveFromContainer(msgs); return basicSetEModelElement((EModelElement)otherEnd, msgs); } return eDynamicInverseAdd(otherEnd, featureID, msgs);
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/impl/EClassifierImpl.java File path: /emf-2.4.1/src/org/eclipse/emf/ecore/impl/EAnnotationImpl.java
Method name: NotificationChain eInverseAdd(InternalEObject, int, NotificationChain) Method name: NotificationChain eInverseAdd(InternalEObject, int, NotificationChain)
Number of AST nodes: 8 Number of AST nodes: 8
1
switch (featureID)
1
switch (featureID)
2
    {
2
    {
3
      case EcorePackage.ECLASSIFIER__EANNOTATIONS:
3
      case EcorePackage.EANNOTATION__EANNOTATIONS:
4
        return ((InternalEList<InternalEObject>)(InternalEList<?>)getEAnnotations()).basicAdd(otherEnd, msgs);
4
        return ((InternalEList<InternalEObject>)(InternalEList<?>)getEAnnotations()).basicAdd(otherEnd, msgs);
5
      case EcorePackage.ECLASSIFIER__EPACKAGE:
5
      case EcorePackage.EANNOTATION__EMODEL_ELEMENT:
6
        if (eInternalContainer() != null)
6
        if (eInternalContainer() != null)
7
          msgs = eBasicRemoveFromContainer(msgs);
7
          msgs = eBasicRemoveFromContainer(msgs);
8
        return eBasicSetContainer(otherEnd, EcorePackage.ECLASSIFIER__EPACKAGE, msgs);
8
        return basicSetEModelElement((EModelElement)otherEnd, msgs);
9
    }
9
    }
10
    return eDynamicInverseAdd(otherEnd, featureID, msgs);
10
    return eDynamicInverseAdd(otherEnd, featureID, msgs);
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 having the same super class
Number of node comparisons18
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements8
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)3.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    switch (featureID)
    1
    switch (featureID)
    2
    case EcorePackage.ECLASSIFIER__EANNOTATIONS:
    2
    case EcorePackage.ECLASSIFIER__EANNOTATIONS:
    2
    case EcorePackage.EANNOTATION__EANNOTATIONS:
    Differences
    Expression1Expression2Difference
    ECLASSIFIER__EANNOTATIONSEANNOTATION__EANNOTATIONSVARIABLE_NAME_MISMATCH
    2
    case EcorePackage.EANNOTATION__EANNOTATIONS:
    3
    return ((InternalEList<InternalEObject>)(InternalEList<?>)getEAnnotations()).basicAdd(otherEnd, msgs);
    3
    return ((InternalEList<InternalEObject>)(InternalEList<?>)getEAnnotations()).basicAdd(otherEnd, msgs);
    4
    case EcorePackage.ECLASSIFIER__EPACKAGE:
    4
    case EcorePackage.ECLASSIFIER__EPACKAGE:
    4
    case EcorePackage.EANNOTATION__EMODEL_ELEMENT:
    Differences
    Expression1Expression2Difference
    ECLASSIFIER__EPACKAGEEANNOTATION__EMODEL_ELEMENTVARIABLE_NAME_MISMATCH
    4
    case EcorePackage.EANNOTATION__EMODEL_ELEMENT:
    5
    if (eInternalContainer() != null)
    5
    if (eInternalContainer() != null)
    6
    msgs = eBasicRemoveFromContainer(msgs);
    6
    msgs = eBasicRemoveFromContainer(msgs);
    7
    return eBasicSetContainer(otherEnd, EcorePackage.ECLASSIFIER__EPACKAGE, msgs);
    7
    return eBasicSetContainer(otherEnd, EcorePackage.ECLASSIFIER__EPACKAGE, msgs);
    7
    return basicSetEModelElement((EModelElement)otherEnd, msgs);
    Differences
    Expression1Expression2Difference
    eBasicSetContainerbasicSetEModelElementMETHOD_INVOCATION_NAME_MISMATCH
    eBasicSetContainer(otherEnd,EcorePackage.ECLASSIFIER__EPACKAGE,msgs)basicSetEModelElement((EModelElement)otherEnd,msgs)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression eBasicSetContainer(otherEnd,EcorePackage.ECLASSIFIER__EPACKAGE,msgs) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression basicSetEModelElement((EModelElement)otherEnd,msgs) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression eBasicSetContainer(otherEnd,EcorePackage.ECLASSIFIER__EPACKAGE,msgs) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression basicSetEModelElement((EModelElement)otherEnd,msgs) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7
    return basicSetEModelElement((EModelElement)otherEnd, msgs);
    8
    return eDynamicInverseAdd(otherEnd, featureID, msgs);
    8
    return eDynamicInverseAdd(otherEnd, featureID, msgs);
    Precondition Violations (4)
    Row Violation
    1Expression eBasicSetContainer(otherEnd,EcorePackage.ECLASSIFIER__EPACKAGE,msgs) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression basicSetEModelElement((EModelElement)otherEnd,msgs) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression eBasicSetContainer(otherEnd,EcorePackage.ECLASSIFIER__EPACKAGE,msgs) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression basicSetEModelElement((EModelElement)otherEnd,msgs) cannot be parameterized, because it has dependencies to/from statements that will be extracted