if (newEFactoryInstance != eFactoryInstance) { NotificationChain msgs = null; if (eFactoryInstance != null) msgs = ((InternalEObject)eFactoryInstance).eInverseRemove(this, EcorePackage.EFACTORY__EPACKAGE, EFactory.class, msgs); if (newEFactoryInstance != null) msgs = ((InternalEObject)newEFactoryInstance).eInverseAdd(this, EcorePackage.EFACTORY__EPACKAGE, EFactory.class, msgs); msgs = basicSetEFactoryInstance(newEFactoryInstance, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, EcorePackage.EPACKAGE__EFACTORY_INSTANCE, newEFactoryInstance, newEFactoryInstance));
if (newHelper != helper) { NotificationChain msgs = null; if (helper != null) msgs = ((InternalEObject)helper).eInverseRemove(this, MappingPackage.MAPPING_HELPER__MAPPER, MappingHelper.class, msgs); if (newHelper != null) msgs = ((InternalEObject)newHelper).eInverseAdd(this, MappingPackage.MAPPING_HELPER__MAPPER, MappingHelper.class, msgs); msgs = basicSetHelper(newHelper, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, MappingPackage.MAPPING__HELPER, newHelper, newHelper));
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/impl/EPackageImpl.java File path: /emf-2.4.1/src/org/eclipse/emf/mapping/impl/MappingImpl.java
Method name: void setEFactoryInstance(EFactory) Method name: void setHelper(MappingHelper)
Number of AST nodes: 11 Number of AST nodes: 11
1
if (newEFactoryInstance != eFactoryInstance)
1
if (newHelper != helper)
2
    {
2
    {
3
      NotificationChain msgs = null;
3
      NotificationChain msgs = null;
4
      if (eFactoryInstance != null)
4
      if (helper != null)
5
        msgs = ((InternalEObject)eFactoryInstance).eInverseRemove(this, EcorePackage.EFACTORY__EPACKAGE, EFactory.class, msgs);
5
        msgs = ((InternalEObject)helper).eInverseRemove(this, MappingPackage.MAPPING_HELPER__MAPPER, MappingHelper.class, msgs);
6
      if (newEFactoryInstance != null)
6
      if (newHelper != null)
7
        msgs = ((InternalEObject)newEFactoryInstance).eInverseAdd(this, EcorePackage.EFACTORY__EPACKAGE, EFactory.class, msgs);
7
        msgs = ((InternalEObject)newHelper).eInverseAdd(this, MappingPackage.
8
      msgs = basicSetEFactoryInstance(newEFactoryInstance
8
MAPPING_HELPER__MAPPER, MappingHelper.class, msgs);
9
, msgs);
9
      msgs = basicSetHelper(newHelper, msgs);
10
      if (msgs != null) msgs.dispatch();
10
      if (msgs != null) msgs.dispatch();
11
    }
11
    }
12
    else if (eNotificationRequired())
12
    else if (eNotificationRequired())
13
      eNotify(new ENotificationImpl(this, Notification.SET, EcorePackage.EPACKAGE__EFACTORY_INSTANCE, newEFactoryInstance, newEFactoryInstance));
13
      eNotify(new ENotificationImpl(this, Notification.SET, MappingPackage.MAPPING__HELPER, newHelper, newHelper));
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.5
Clones locationClones are in different classes having the same super class
Number of node comparisons32
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements7
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)1.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    2
    NotificationChain msgs = null;
    2
    NotificationChain msgs = null;
    3
    if (eFactoryInstance != null)
    3
    if (eFactoryInstance != null)
    3
    if (helper != null)
    Differences
    Expression1Expression2Difference
    eFactoryInstancehelperVARIABLE_NAME_MISMATCH
    org.eclipse.emf.ecore.EFactoryorg.eclipse.emf.mapping.MappingHelperVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.ecore.EFactory of variable eFactoryInstance does not match with type org.eclipse.emf.mapping.MappingHelper of variable helper
    • Make classes org.eclipse.emf.ecore.EFactory and org.eclipse.emf.mapping.MappingHelper extend a common superclass
    3
    if (helper != null)
    4
    msgs = ((InternalEObject)eFactoryInstance).eInverseRemove(this, EcorePackage.EFACTORY__EPACKAGE, EFactory.class, msgs);
    4
    msgs = ((InternalEObject)eFactoryInstance).eInverseRemove(this, EcorePackage.EFACTORY__EPACKAGE, EFactory.class, msgs);
    4
    msgs = ((InternalEObject)helper).eInverseRemove(this, MappingPackage.MAPPING_HELPER__MAPPER, MappingHelper.class, msgs);
    Differences
    Expression1Expression2Difference
    org.eclipse.emf.ecore.EcorePackageorg.eclipse.emf.mapping.MappingPackageVARIABLE_TYPE_MISMATCH
    EFACTORY__EPACKAGEMAPPING_HELPER__MAPPERVARIABLE_NAME_MISMATCH
    eFactoryInstancehelperVARIABLE_NAME_MISMATCH
    org.eclipse.emf.ecore.EFactoryorg.eclipse.emf.mapping.MappingHelperVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.ecore.EcorePackage of variable EcorePackage does not match with type org.eclipse.emf.mapping.MappingPackage of variable MappingPackage
    • Make classes org.eclipse.emf.ecore.EcorePackage and org.eclipse.emf.mapping.MappingPackage extend a common superclass
    Type org.eclipse.emf.ecore.EFactory of variable eFactoryInstance does not match with type org.eclipse.emf.mapping.MappingHelper of variable helper
    • Make classes org.eclipse.emf.ecore.EFactory and org.eclipse.emf.mapping.MappingHelper extend a common superclass
    4
    msgs = ((InternalEObject)helper).eInverseRemove(this, MappingPackage.MAPPING_HELPER__MAPPER, MappingHelper.class, msgs);
    5
    if (newEFactoryInstance != null)
    5
    if (newEFactoryInstance != null)
    5
    if (newHelper != null)
    Differences
    Expression1Expression2Difference
    newEFactoryInstancenewHelperVARIABLE_NAME_MISMATCH
    org.eclipse.emf.ecore.EFactoryorg.eclipse.emf.mapping.MappingHelperVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.ecore.EFactory of variable newEFactoryInstance does not match with type org.eclipse.emf.mapping.MappingHelper of variable newHelper
    • Make classes org.eclipse.emf.ecore.EFactory and org.eclipse.emf.mapping.MappingHelper extend a common superclass
    5
    if (newHelper != null)
    6
    msgs = ((InternalEObject)newEFactoryInstance).eInverseAdd(this, EcorePackage.EFACTORY__EPACKAGE, EFactory.class, msgs);
    6
    msgs = ((InternalEObject)newEFactoryInstance).eInverseAdd(this, EcorePackage.EFACTORY__EPACKAGE, EFactory.class, msgs);
    6
    msgs = ((InternalEObject)newHelper).eInverseAdd(this, MappingPackage.MAPPING_HELPER__MAPPER, MappingHelper.class, msgs);
    Differences
    Expression1Expression2Difference
    org.eclipse.emf.ecore.EcorePackageorg.eclipse.emf.mapping.MappingPackageVARIABLE_TYPE_MISMATCH
    EFACTORY__EPACKAGEMAPPING_HELPER__MAPPERVARIABLE_NAME_MISMATCH
    newEFactoryInstancenewHelperVARIABLE_NAME_MISMATCH
    org.eclipse.emf.ecore.EFactoryorg.eclipse.emf.mapping.MappingHelperVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.ecore.EcorePackage of variable EcorePackage does not match with type org.eclipse.emf.mapping.MappingPackage of variable MappingPackage
    • Make classes org.eclipse.emf.ecore.EcorePackage and org.eclipse.emf.mapping.MappingPackage extend a common superclass
    Type org.eclipse.emf.ecore.EFactory of variable newEFactoryInstance does not match with type org.eclipse.emf.mapping.MappingHelper of variable newHelper
    • Make classes org.eclipse.emf.ecore.EFactory and org.eclipse.emf.mapping.MappingHelper extend a common superclass
    6
    msgs = ((InternalEObject)newHelper).eInverseAdd(this, MappingPackage.MAPPING_HELPER__MAPPER, MappingHelper.class, msgs);
                                                                                  
    7
    msgs = basicSetHelper(newHelper, msgs);
    Preondition Violations
    Unmatched statement msgs=basicSetHelper(newHelper,msgs); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    7
    msgs = basicSetHelper(newHelper, msgs);
    7
    msgs = basicSetEFactoryInstance(newEFactoryInstance, msgs);
    7
    msgs = basicSetEFactoryInstance(newEFactoryInstance, msgs);
    Preondition Violations
    Unmatched statement msgs=basicSetEFactoryInstance(newEFactoryInstance,msgs); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                          
    8
    if (msgs != null)
    8
    if (msgs != null)
    9
    msgs.dispatch();
    9
    msgs.dispatch();
    Precondition Violations (8)
    Row Violation
    1Type org.eclipse.emf.ecore.EFactory of variable eFactoryInstance does not match with type org.eclipse.emf.mapping.MappingHelper of variable helper
    2Type org.eclipse.emf.ecore.EcorePackage of variable EcorePackage does not match with type org.eclipse.emf.mapping.MappingPackage of variable MappingPackage
    3Type org.eclipse.emf.ecore.EFactory of variable eFactoryInstance does not match with type org.eclipse.emf.mapping.MappingHelper of variable helper
    4Type org.eclipse.emf.ecore.EFactory of variable newEFactoryInstance does not match with type org.eclipse.emf.mapping.MappingHelper of variable newHelper
    5Type org.eclipse.emf.ecore.EcorePackage of variable EcorePackage does not match with type org.eclipse.emf.mapping.MappingPackage of variable MappingPackage
    6Type org.eclipse.emf.ecore.EFactory of variable newEFactoryInstance does not match with type org.eclipse.emf.mapping.MappingHelper of variable newHelper
    7Unmatched statement msgs=basicSetHelper(newHelper,msgs); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    8Unmatched statement msgs=basicSetEFactoryInstance(newEFactoryInstance,msgs); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted