EGenericType oldEUpperBound = eUpperBound; eUpperBound = newEUpperBound; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EcorePackage.EGENERIC_TYPE__EUPPER_BOUND, oldEUpperBound, newEUpperBound); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs;
EPackage oldEPackage = ePackage; ePackage = newEPackage; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EcorePackage.EFACTORY__EPACKAGE, oldEPackage, newEPackage); 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/EGenericTypeImpl.java File path: /emf-2.4.1/src/org/eclipse/emf/ecore/impl/EFactoryImpl.java
Method name: NotificationChain basicSetEUpperBound(EGenericType, NotificationChain) Method name: NotificationChain basicSetEPackage(EPackage, NotificationChain)
Number of AST nodes: 8 Number of AST nodes: 8
1
EGenericType oldEUpperBound = eUpperBound;
1
E
2
    eUpperBound = newEUpperBound
2
Package oldEPackage = ePackage;
3
;
3
    ePackage = newEPackage;
4
    if (eNotificationRequired())
4
    if (eNotificationRequired())
5
    {
5
    {
6
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EcorePackage.EGENERIC_TYPE__EUPPER_BOUND, oldEUpperBound, newEUpperBound);
6
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EcorePackage.EFACTORY__EPACKAGE, oldEPackage, newEPackage);
7
      if (msgs == null) msgs = notification; else msgs.add(notification);
7
      if (msgs == null) msgs = notification; else msgs.add(notification);
8
    }
8
    }
9
    return msgs;
9
    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.1
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.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                                                      
    1
    EPackage oldEPackage = ePackage;
    1
    EGenericType oldEUpperBound = eUpperBound;
                                                                                          
                                                    
    2
    ePackage = newEPackage;
    2
    eUpperBound = newEUpperBound;
                                                                
    3
    if (eNotificationRequired())
    3
    if (eNotificationRequired())
    4
    ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EcorePackage.EGENERIC_TYPE__EUPPER_BOUND, oldEUpperBound, newEUpperBound);
    4
    ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EcorePackage.EGENERIC_TYPE__EUPPER_BOUND, oldEUpperBound, newEUpperBound);
    4
    ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EcorePackage.EFACTORY__EPACKAGE, oldEPackage, newEPackage);
    Differences
    Expression1Expression2Difference
    EGENERIC_TYPE__EUPPER_BOUNDEFACTORY__EPACKAGEVARIABLE_NAME_MISMATCH
    oldEUpperBoundoldEPackageVARIABLE_NAME_MISMATCH
    org.eclipse.emf.ecore.EGenericTypeorg.eclipse.emf.ecore.EPackageVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.ecore.EGenericType of variable oldEUpperBound does not match with type org.eclipse.emf.ecore.EPackage of variable oldEPackage
    • Make classes org.eclipse.emf.ecore.EGenericType and org.eclipse.emf.ecore.EPackage extend a common superclass
    4
    ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EcorePackage.EFACTORY__EPACKAGE, oldEPackage, newEPackage);
    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 (1)
    Row Violation
    1Type org.eclipse.emf.ecore.EGenericType of variable oldEUpperBound does not match with type org.eclipse.emf.ecore.EPackage of variable oldEPackage