doAddAllUnique(index, collection); if (hasInverse()) { NotificationChain notifications = createNotificationChain(collectionSize); int lastIndex = index + collectionSize; for (int i = index; i < lastIndex; ++i) { @SuppressWarnings("unchecked") E object = (E)data[i]; notifications = inverseAdd(object, notifications); } if (notifications != null) notifications.dispatch(); }
doAddAllUnique(index, objects, start, end); if (hasInverse()) { NotificationChain notifications = createNotificationChain(collectionSize); int lastIndex = index + collectionSize; for (int i = index; i < lastIndex; ++i) { @SuppressWarnings("unchecked") E object = (E)data[i]; notifications = inverseAdd(object, notifications); } if (notifications != null) notifications.dispatch(); }
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/common/notify/impl/NotifyingListImpl.java File path: /emf-2.4.1/src/org/eclipse/emf/common/notify/impl/NotifyingListImpl.java
Method name: boolean addAllUnique(int, Collection) Method name: boolean addAllUnique(int, Object[], int, int)
Number of AST nodes: 9 Number of AST nodes: 9
1
doAddAllUnique(index, collection);
1
doAddAllUnique(index, objects, start, end);
2
        if (hasInverse())
2
        if (hasInverse())
3
        {
3
        {
4
          NotificationChain notifications = createNotificationChain(collectionSize);
4
          NotificationChain notifications = createNotificationChain(collectionSize);
5
          int lastIndex = index + collectionSize;
5
          int lastIndex = index + collectionSize;
6
          for (int i = index; i < lastIndex; ++i)
6
          for (int i = index; i < lastIndex; ++i)
7
          {            
7
          {            
8
            @SuppressWarnings("unchecked") E object = (E)data[i];
8
            @SuppressWarnings("unchecked") E object = (E)data[i];
9
            notifications = inverseAdd(object, notifications);
9
            notifications = inverseAdd(object, notifications);
10
          }
10
          }
11
          if (notifications != null) notifications.dispatch();
11
          if (notifications != null) notifications.dispatch();
12
        }
12
        }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.9
Clones locationClones are declared in the same class
Number of node comparisons58
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements9
    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
    20
    doAddAllUnique(index, collection);
    20
    doAddAllUnique(index, collection);
    28
    doAddAllUnique(index, objects, start, end);
    Differences
    Expression1Expression2Difference
    doAddAllUnique(index,collection)doAddAllUnique(index,objects,start,end)ARGUMENT_NUMBER_MISMATCH
    28
    doAddAllUnique(index, objects, start, end);
    21
    if (hasInverse())
    29
    if (hasInverse())
    22
    NotificationChain notifications = createNotificationChain(collectionSize);
    30
    NotificationChain notifications = createNotificationChain(collectionSize);
    23
    int lastIndex = index + collectionSize;
    31
    int lastIndex = index + collectionSize;
    24
    for (int i = index; i < lastIndex; ++i)
    32
    for (int i = index; i < lastIndex; ++i)
    25
    @SuppressWarnings("unchecked") E object = (E)data[i];
    33
    @SuppressWarnings("unchecked") E object = (E)data[i];
    26
    notifications = inverseAdd(object, notifications);
    34
    notifications = inverseAdd(object, notifications);
    27
    if (notifications != null)
    35
    if (notifications != null)
    28
    notifications.dispatch();
    36
    notifications.dispatch();
    Precondition Violations (0)
    Row Violation