ENotificationImpl notification = new ENotificationImpl (owner, Notification.ADD, EcorePackage.ECLASS__ESUPER_TYPES, null, unwrap(eGenericType), indexOf(eGenericType), false); if (notifications == null) { notifications = notification; } else { notifications.add(notification); } return notifications;
ENotificationImpl notification = new ENotificationImpl (owner, Notification.ADD, EcorePackage.EOPERATION__EEXCEPTIONS, null, unwrap(eGenericType), indexOf(eGenericType), false); if (notifications == null) { notifications = notification; } else { notifications.add(notification); } return notifications;
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/impl/EClassImpl.java File path: /emf-2.4.1/src/org/eclipse/emf/ecore/impl/EOperationImpl.java
Method name: NotificationChain shadowAdd(EGenericType, NotificationChain) Method name: NotificationChain shadowAdd(EGenericType, NotificationChain)
Number of AST nodes: 5 Number of AST nodes: 5
1
ENotificationImpl notification =
1
ENotificationImpl notification =
2
              new ENotificationImpl
2
              new ENotificationImpl
3
                (owner, Notification.ADD, EcorePackage.ECLASS__ESUPER_TYPES, null, unwrap(eGenericType), indexOf(eGenericType), false);
3
                (owner, Notification.ADD, EcorePackage.EOPERATION__EEXCEPTIONS, null, unwrap(eGenericType), indexOf(eGenericType), false);
4
            if (notifications == null)
4
            if (notifications == null)
5
            {
5
            {
6
              notifications = notification;
6
              notifications = notification;
7
            }
7
            }
8
            else
8
            else
9
            {
9
            {
10
              notifications.add(notification);
10
              notifications.add(notification);
11
            }
11
            }
12
            return notifications;
12
            return notifications;
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 comparisons11
  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.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    ENotificationImpl notification = new ENotificationImpl(owner, Notification.ADD, EcorePackage.ECLASS__ESUPER_TYPES, null, unwrap(eGenericType), indexOf(eGenericType), false);
    1
    ENotificationImpl notification = new ENotificationImpl(owner, Notification.ADD, EcorePackage.ECLASS__ESUPER_TYPES, null, unwrap(eGenericType), indexOf(eGenericType), false);
    1
    ENotificationImpl notification = new ENotificationImpl(owner, Notification.ADD, EcorePackage.EOPERATION__EEXCEPTIONS, null, unwrap(eGenericType), indexOf(eGenericType), false);
    Differences
    Expression1Expression2Difference
    ECLASS__ESUPER_TYPESEOPERATION__EEXCEPTIONSVARIABLE_NAME_MISMATCH
    org.eclipse.emf.ecore.EClassorg.eclipse.emf.ecore.EClassifierVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.ecore.EClass of variable unwrap(eGenericType) does not match with type org.eclipse.emf.ecore.EClassifier of variable unwrap(eGenericType)
    • Make classes org.eclipse.emf.ecore.EClass and org.eclipse.emf.ecore.EClassifier extend a common superclass
    1
    ENotificationImpl notification = new ENotificationImpl(owner, Notification.ADD, EcorePackage.EOPERATION__EEXCEPTIONS, null, unwrap(eGenericType), indexOf(eGenericType), false);
    2
    if (notifications == null)
    2
    if (notifications == null)
    3
    notifications = notification;
    3
    notifications = notification;
    else
    else
    4
    notifications.add(notification);
    4
    notifications.add(notification);
    5
    return notifications;
    5
    return notifications;
    Precondition Violations (1)
    Row Violation
    1Type org.eclipse.emf.ecore.EClass of variable unwrap(eGenericType) does not match with type org.eclipse.emf.ecore.EClassifier of variable unwrap(eGenericType)