if (start != 0 || end != objects.length) { Object [] actualObjects = new Object [collectionSize]; for (int i = 0, j = start; j < end; ++i, ++j) { actualObjects[i] = objects[j]; } notification = createNotification(Notification.ADD_MANY, null, Arrays.asList(actualObjects), index, oldIsSet); } else { notification = createNotification(Notification.ADD_MANY, null, Arrays.asList(objects), index, oldIsSet); }
if (start != 0 || end != objects.length) { Object [] actualObjects = new Object [collectionSize]; for (int i = 0, j = start; j < end; ++i, ++j) { actualObjects[i] = objects[j]; } notification = createNotification(Notification.ADD_MANY, null, Arrays.asList(actualObjects), index, oldIsSet); } else { notification = createNotification(Notification.ADD_MANY, null, Arrays.asList(objects), index, oldIsSet); }
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: boolean addAllUnique(int, Object[], int, int) Method name: boolean addAllUnique(int, Object[], int, int)
Number of AST nodes: 6 Number of AST nodes: 6
1
if (start != 0 || end != objects.length)
1
if (start != 0 || end != objects.length)
2
          {
2
          {
3
            Object [] actualObjects = new Object [collectionSize];
3
            Object [] actualObjects = new Object [collectionSize];
4
            for (int i = 0, j = start; j < end; ++i, ++j)
4
            for (int i = 0, j = start; j < end; ++i, ++j)
5
            {
5
            {
6
              actualObjects[i] = objects[j];
6
              actualObjects[i] = objects[j];
7
            }
7
            }
8
            notification = createNotification(Notification.ADD_MANY, null, Arrays.asList(actualObjects), index, oldIsSet);
8
            notification = createNotification(Notification.ADD_MANY, null, Arrays.asList(actualObjects), index, oldIsSet);
9
          }
9
          }
10
          else
10
          else
11
          {
11
          {
12
            notification =  createNotification(Notification.ADD_MANY, null, Arrays.asList(objects), index, oldIsSet);
12
            notification =  createNotification(Notification.ADD_MANY, null, Arrays.asList(objects), index, oldIsSet);
13
          }
13
          }
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.4
Clones locationClones are in different classes having the same super class
Number of node comparisons21
  1. {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)1.6
    Clone typeType 1
    Mapped Statements
    ID Statement ID Statement
    10
    if (start != 0 || end != objects.length)
    10
    if (start != 0 || end != objects.length)
    11
    Object[] actualObjects = new Object[collectionSize];
    11
    Object[] actualObjects = new Object[collectionSize];
    12
    for (int i = 0, j = start; j < end; ++i, ++j)
    12
    for (int i = 0, j = start; j < end; ++i, ++j)
    13
    actualObjects[i] = objects[j];
    13
    actualObjects[i] = objects[j];
    14
    notification = createNotification(Notification.ADD_MANY, null, Arrays.asList(actualObjects), index, oldIsSet);
    14
    notification = createNotification(Notification.ADD_MANY, null, Arrays.asList(actualObjects), index, oldIsSet);
    else
    else
    15
    notification = createNotification(Notification.ADD_MANY, null, Arrays.asList(objects), index, oldIsSet);
    15
    notification = createNotification(Notification.ADD_MANY, null, Arrays.asList(objects), index, oldIsSet);
    Precondition Violations (0)
    Row Violation