for (Iterator<E> i = collection.iterator(); i.hasNext(); ) { notifications = inverseRemove(i.next(), notifications); } if (notifications == null) { dispatchNotification(notification); } else { notifications.add(notification); notifications.dispatch(); }
for (Iterator<E> i = collection.iterator(); i.hasNext(); ) { notifications = inverseRemove(i.next(), notifications); } 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: 6 Number of AST nodes: 6
1
for (Iterator<E> i = collection.iterator(); i.hasNext(); )
1
for (Iterator<E> i = collection.iterator(); i.hasNext(); )
2
          {
2
          {
3
            notifications = inverseRemove(i.next(), notifications);
3
            notifications = inverseRemove(i.next(), notifications);
4
          }
4
          }
5
          if (notifications == null)
5
          if (notifications == null)
6
          {
6
          {
7
            dispatchNotification(notification);
7
            dispatchNotification(notification);
8
          }
8
          }
9
          else
9
          else
10
          {
10
          {
11
            notifications.add(notification);
11
            notifications.add(notification);
12
            notifications.dispatch();
12
            notifications.dispatch();
13
          }
13
          }
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.3
Clones locationClones are in different classes having the same super class
Number of node comparisons33
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements6
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)7.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    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();
    Precondition Violations (1)
    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