EClassifier oldEClassifier = eClassifier; eClassifier = newEClassifier; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EcorePackage.EGENERIC_TYPE__ECLASSIFIER, oldEClassifier, eClassifier); if (msgs == null) { msgs = notification; } else { msgs.add(notification); } } return msgs;
EClassifier oldEType = eType; eType = newEType; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EcorePackage.ETYPED_ELEMENT__ETYPE, oldEType, eType); 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/ETypedElementImpl.java
Method name: NotificationChain setEClassifier(EClassifier, NotificationChain) Method name: NotificationChain setEType(EClassifier, NotificationChain)
Number of AST nodes: 8 Number of AST nodes: 8
1
EClassifier oldEClassifier = eClassifier;
1
EClassifier oldE
2
    eClassifier = newEClassifier
2
Type = eType;
3
;
3
    eType = newEType;
4
    if (eNotificationRequired())
4
    if (eNotificationRequired())
5
    {
5
    {
6
      ENotificationImpl notification = 
6
      ENotificationImpl notification = 
7
        new ENotificationImpl(this, Notification.SET, EcorePackage.EGENERIC_TYPE__ECLASSIFIER, oldEClassifier, eClassifier);
7
new ENotificationImpl(this, Notification.SET, EcorePackage.ETYPED_ELEMENT__ETYPE, oldEType, eType);
8
      if (msgs == null)
8
      if (msgs == null)
9
      {
9
      {
10
        msgs = notification;
10
        msgs = notification;
11
      }
11
      }
12
      else
12
      else
13
      {
13
      {
14
        msgs.add(notification);
14
        msgs.add(notification);
15
      }
15
      }
16
    }
16
    }
17
    return msgs;
17
   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 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)1.3
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    EClassifier oldEClassifier = eClassifier;
    1
    EClassifier oldEClassifier = eClassifier;
    1
    EClassifier oldEType = eType;
    Differences
    Expression1Expression2Difference
    oldEClassifieroldETypeVARIABLE_NAME_MISMATCH
    eClassifiereTypeVARIABLE_NAME_MISMATCH
    1
    EClassifier oldEType = eType;
    2
    eClassifier = newEClassifier;
    2
    eClassifier = newEClassifier;
    2
    eType = newEType;
    Differences
    Expression1Expression2Difference
    eClassifiereTypeVARIABLE_NAME_MISMATCH
    newEClassifiernewETypeVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression eClassifier is a field being modified, and thus it cannot be parameterized
    Expression eType is a field being modified, and thus it cannot be parameterized
    2
    eType = newEType;
    3
    if (eNotificationRequired())
    3
    if (eNotificationRequired())
    4
    ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EcorePackage.EGENERIC_TYPE__ECLASSIFIER, oldEClassifier, eClassifier);
    4
    ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EcorePackage.EGENERIC_TYPE__ECLASSIFIER, oldEClassifier, eClassifier);
    4
    ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EcorePackage.ETYPED_ELEMENT__ETYPE, oldEType, eType);
    Differences
    Expression1Expression2Difference
    EGENERIC_TYPE__ECLASSIFIERETYPED_ELEMENT__ETYPEVARIABLE_NAME_MISMATCH
    oldEClassifieroldETypeVARIABLE_NAME_MISMATCH
    eClassifiereTypeVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression eClassifier cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression eType cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4
    ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EcorePackage.ETYPED_ELEMENT__ETYPE, oldEType, eType);
    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 (4)
    Row Violation
    1Expression eClassifier is a field being modified, and thus it cannot be parameterized
    2Expression eType is a field being modified, and thus it cannot be parameterized
    3Expression eClassifier cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression eType cannot be parameterized, because it has dependencies to/from statements that will be extracted