Notification notification = (collectionSize == 1 ? createNotification(Notification.REMOVE, collection.get(0), null, 0, oldIsSet) : createNotification(Notification.REMOVE_MANY, collection, null, Notification.NO_INDEX, oldIsSet)); if (hasInverse()) { for (Iterator<E> i = collection.iterator(); i.hasNext(); ) { notifications = inverseRemove(i.next(), notifications); } if (notifications == null) { dispatchNotification(notification); } else { notifications.add(notification); notifications.dispatch(); } } else { if (notifications == null) { dispatchNotification(notification); } else { notifications.add(notification); notifications.dispatch(); } }
Notification notification = (collectionSize == 1 ? createNotification(Notification.REMOVE, collection.get(0), null, 0, oldIsSet) : createNotification(Notification.REMOVE_MANY, collection, null, Notification.NO_INDEX, oldIsSet)); if (hasInverse()) { for (Iterator<E> i = collection.iterator(); i.hasNext(); ) { notifications = inverseRemove(i.next(), notifications); } if (notifications == null) { dispatchNotification(notification); } else { notifications.add(notification); notifications.dispatch(); } } else { if (notifications == null) { dispatchNotification(notification); } else { notifications.add(notification); notifications.dispatch(); } }
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/common/notify/impl/DelegatingNotifyingListImpl.java File path: /emf-2.4.1/src/org/eclipse/emf/common/notify/impl/NotifyingListImpl.java
Method name: void clear() Method name: void clear()
Number of AST nodes: 12 Number of AST nodes: 12
1
Notification notification =
1
Notification notification =
2
          (collectionSize == 1 ?
2
          (collectionSize == 1 ?
3
            createNotification(Notification.REMOVE, collection.get(0), null, 0, oldIsSet) :
3
            createNotification(Notification.REMOVE, collection.get(0), null, 0, oldIsSet) :
4
            createNotification(Notification.REMOVE_MANY, collection, null, Notification.NO_INDEX, oldIsSet));
4
            createNotification(Notification.REMOVE_MANY, collection, null, Notification.NO_INDEX, oldIsSet));
5
        if (hasInverse())
5
        if (hasInverse())
6
        {
6
        {
7
          for (Iterator<E> i = collection.iterator(); i.hasNext(); )
7
          for (Iterator<E> i = collection.iterator(); i.hasNext(); )
8
          {
8
          {
9
            notifications = inverseRemove(i.next(), notifications);
9
            notifications = inverseRemove(i.next(), notifications);
10
          }
10
          }
11
          if (notifications == null)
11
          if (notifications == null)
12
          {
12
          {
13
            dispatchNotification(notification);
13
            dispatchNotification(notification);
14
          }
14
          }
15
          else
15
          else
16
          {
16
          {
17
            notifications.add(notification);
17
            notifications.add(notification);
18
            notifications.dispatch();
18
            notifications.dispatch();
19
          }
19
          }
20
        }
20
        }
21
        else
21
        else
22
        {
22
        {
23
          if (notifications == null)
23
          if (notifications == null)
24
          {
24
          {
25
            dispatchNotification(notification);
25
            dispatchNotification(notification);
26
          }
26
          }
27
          else
27
          else
28
          {
28
          {
29
            notifications.add(notification);
29
            notifications.add(notification);
30
            notifications.dispatch();
30
            notifications.dispatch();
31
          }
31
          }
32
        }
32
        }
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.6
Clones locationClones are in different classes having the same super class
Number of node comparisons62
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements12
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)9.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    12
    Notification notification = (collectionSize == 1 ? createNotification(Notification.REMOVE, collection.get(0), null, 0, oldIsSet) : createNotification(Notification.REMOVE_MANY, collection, null, Notification.NO_INDEX, oldIsSet));
    12
    Notification notification = (collectionSize == 1 ? createNotification(Notification.REMOVE, collection.get(0), null, 0, oldIsSet) : createNotification(Notification.REMOVE_MANY, collection, null, Notification.NO_INDEX, oldIsSet));
    12
    Notification notification = (collectionSize == 1 ? createNotification(Notification.REMOVE, collection.get(0), null, 0, oldIsSet) : createNotification(Notification.REMOVE_MANY, collection, null, Notification.NO_INDEX, oldIsSet));
    Differences
    Expression1Expression2Difference
    org.eclipse.emf.common.util.BasicEListjava.util.ListVARIABLE_TYPE_MISMATCH
    org.eclipse.emf.common.util.BasicEListjava.util.ListVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.common.util.BasicEList<E> of variable collection does not match with type java.util.List<E> of variable collection
    • Make classes org.eclipse.emf.common.util.BasicEList and java.util.List extend a common superclass
    Type org.eclipse.emf.common.util.BasicEList<E> of variable collection does not match with type java.util.List<E> of variable collection
    • Make classes org.eclipse.emf.common.util.BasicEList and java.util.List extend a common superclass
    12
    Notification notification = (collectionSize == 1 ? createNotification(Notification.REMOVE, collection.get(0), null, 0, oldIsSet) : createNotification(Notification.REMOVE_MANY, collection, null, Notification.NO_INDEX, oldIsSet));
    13
    if (hasInverse())
    13
    if (hasInverse())
    14
    for (Iterator<E> i = collection.iterator(); i.hasNext(); )
    14
    for (Iterator<E> i = collection.iterator(); i.hasNext(); )
    14
    for (Iterator<E> i = collection.iterator(); i.hasNext(); )
    Differences
    Expression1Expression2Difference
    org.eclipse.emf.common.util.BasicEListjava.util.ListVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.common.util.BasicEList<E> of variable collection does not match with type java.util.List<E> of variable collection
    • Make classes org.eclipse.emf.common.util.BasicEList and java.util.List extend a common superclass
    14
    for (Iterator<E> i = collection.iterator(); i.hasNext(); )
    15
    notifications = inverseRemove(i.next(), notifications);
    15
    notifications = inverseRemove(i.next(), notifications);
    16
    if (notifications == null)
    16
    if (notifications == null)
    17
    dispatchNotification(notification);
    17
    dispatchNotification(notification);
    else
    else
    18
    notifications.add(notification);
    18
    notifications.add(notification);
    19
    notifications.dispatch();
    19
    notifications.dispatch();
    else
    else
    20
    if (notifications == null)
    20
    if (notifications == null)
    21
    dispatchNotification(notification);
    21
    dispatchNotification(notification);
    else
    else
    22
    notifications.add(notification);
    22
    notifications.add(notification);
    23
    notifications.dispatch();
    23
    notifications.dispatch();
    Precondition Violations (3)
    Row Violation
    1Type org.eclipse.emf.common.util.BasicEList<E> of variable collection does not match with type java.util.List<E> of variable collection
    2Type org.eclipse.emf.common.util.BasicEList<E> of variable collection does not match with type java.util.List<E> of variable collection
    3Type org.eclipse.emf.common.util.BasicEList<E> of variable collection does not match with type java.util.List<E> of variable collection