EFactory oldEFactoryInstance = eFactoryInstance; eFactoryInstance = newEFactoryInstance; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EcorePackage.EPACKAGE__EFACTORY_INSTANCE, oldEFactoryInstance, newEFactoryInstance); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs;
MappingHelper oldHelper = helper; helper = newHelper; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, MappingPackage.MAPPING__HELPER, oldHelper, newHelper); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs;
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: NotificationChain basicSetEFactoryInstance(EFactory, NotificationChain) Method name: NotificationChain basicSetHelper(MappingHelper, NotificationChain)
Number of AST nodes: 8 Number of AST nodes: 8
1
EFactory oldEFactoryInstance = eFactoryInstance;
2
    eFactoryInstance = newEFactoryInstance
1
MappingHelper oldHelper = helper;
3
;
2
    helper = newHelper;
4
    if (eNotificationRequired())
3
    if (eNotificationRequired())
5
    {
4
    {
6
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EcorePackage.EPACKAGE__EFACTORY_INSTANCE, oldEFactoryInstance, newEFactoryInstance);
5
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, MappingPackage.MAPPING__HELPER, oldHelper, newHelper);
7
      if (msgs == null) msgs = notification; else msgs.add(notification);
6
      if (msgs == null) msgs = notification; else msgs.add(notification);
8
    }
7
    }
9
    return msgs;
8
    return 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.2
Clones locationClones are in different classes having the same super class
Number of node comparisons22
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements6
    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.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                                                        
    1
    MappingHelper oldHelper = helper;
    1
    EFactory oldEFactoryInstance = eFactoryInstance;
                                                                                                      
                                            
    2
    helper = newHelper;
    2
    eFactoryInstance = newEFactoryInstance;
                                                                                    
    3
    if (eNotificationRequired())
    3
    if (eNotificationRequired())
    4
    ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EcorePackage.EPACKAGE__EFACTORY_INSTANCE, oldEFactoryInstance, newEFactoryInstance);
    4
    ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EcorePackage.EPACKAGE__EFACTORY_INSTANCE, oldEFactoryInstance, newEFactoryInstance);
    4
    ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, MappingPackage.MAPPING__HELPER, oldHelper, newHelper);
    Differences
    Expression1Expression2Difference
    org.eclipse.emf.ecore.EcorePackageorg.eclipse.emf.mapping.MappingPackageVARIABLE_TYPE_MISMATCH
    EPACKAGE__EFACTORY_INSTANCEMAPPING__HELPERVARIABLE_NAME_MISMATCH
    oldEFactoryInstanceoldHelperVARIABLE_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 oldEFactoryInstance does not match with type org.eclipse.emf.mapping.MappingHelper of variable oldHelper
    • Make classes org.eclipse.emf.ecore.EFactory and org.eclipse.emf.mapping.MappingHelper extend a common superclass
    4
    ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, MappingPackage.MAPPING__HELPER, oldHelper, newHelper);
    5
    if (msgs == null)
    5
    if (msgs == null)
    6
    msgs = notification;
    6
    msgs = notification;
    else
    else
    7
    msgs.add(notification);
    7
    msgs.add(notification);
    8
    return msgs;
    8
    return msgs;
    Precondition Violations (2)
    Row Violation
    1Type org.eclipse.emf.ecore.EcorePackage of variable EcorePackage does not match with type org.eclipse.emf.mapping.MappingPackage of variable MappingPackage
    2Type org.eclipse.emf.ecore.EFactory of variable oldEFactoryInstance does not match with type org.eclipse.emf.mapping.MappingHelper of variable oldHelper