if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EcorePackage.EGENERIC_TYPE__ETYPE_PARAMETER, oldETypeParameter, newETypeParameter); if (msgs == null) msgs = notification; else msgs.add(notification); }
if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EcorePackage.ETYPED_ELEMENT__EGENERIC_TYPE, oldEGenericType, newEGenericType); if (msgs == null) msgs = notification; else msgs.add(notification); }
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/ETypedElementImpl.java
Method name: NotificationChain basicSetETypeParameter(ETypeParameter, NotificationChain) Method name: NotificationChain basicSetEGenericType(EGenericType, NotificationChain)
Number of AST nodes: 5 Number of AST nodes: 5
1
if (eNotificationRequired())
1
if (eNotificationRequired())
2
    {
2
    {
3
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EcorePackage.EGENERIC_TYPE__ETYPE_PARAMETER, oldETypeParameter, newETypeParameter);
3
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EcorePackage.ETYPED_ELEMENT__EGENERIC_TYPE, oldEGenericType, newEGenericType);
4
      if (msgs == null) msgs = notification; else msgs.add(notification);
4
      if (msgs == null) msgs = notification; else msgs.add(notification);
5
    }
5
    }
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 comparisons13
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    3
    if (eNotificationRequired())
    3
    if (eNotificationRequired())
    4
    ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EcorePackage.EGENERIC_TYPE__ETYPE_PARAMETER, oldETypeParameter, newETypeParameter);
    4
    ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EcorePackage.EGENERIC_TYPE__ETYPE_PARAMETER, oldETypeParameter, newETypeParameter);
    4
    ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EcorePackage.ETYPED_ELEMENT__EGENERIC_TYPE, oldEGenericType, newEGenericType);
    Differences
    Expression1Expression2Difference
    EGENERIC_TYPE__ETYPE_PARAMETERETYPED_ELEMENT__EGENERIC_TYPEVARIABLE_NAME_MISMATCH
    oldETypeParameteroldEGenericTypeVARIABLE_NAME_MISMATCH
    org.eclipse.emf.ecore.ETypeParameterorg.eclipse.emf.ecore.EGenericTypeVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.ecore.ETypeParameter of variable oldETypeParameter does not match with type org.eclipse.emf.ecore.EGenericType of variable oldEGenericType
    • Make classes org.eclipse.emf.ecore.ETypeParameter and org.eclipse.emf.ecore.EGenericType extend a common superclass
    4
    ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EcorePackage.ETYPED_ELEMENT__EGENERIC_TYPE, oldEGenericType, newEGenericType);
    5
    if (msgs == null)
    5
    if (msgs == null)
    6
    msgs = notification;
    6
    msgs = notification;
    else
    else
    7
    msgs.add(notification);
    7
    msgs.add(notification);
    Precondition Violations (1)
    Row Violation
    1Type org.eclipse.emf.ecore.ETypeParameter of variable oldETypeParameter does not match with type org.eclipse.emf.ecore.EGenericType of variable oldEGenericType