if (isNotificationRequired()) { int index = size(); boolean oldIsSet = isSet(); doAddUnique(index, object); NotificationImpl notification = createNotification(Notification.ADD, null, object, index, oldIsSet); if (notifications == null) { notifications = notification; } else { notifications.add(notification); } } else { doAddUnique(size(), object); } return notifications;
if (isNotificationRequired()) { int index = size; boolean oldIsSet = isSet(); doAddUnique(index, object); NotificationImpl notification = createNotification(Notification.ADD, null, object, index, oldIsSet); if (notifications == null) { notifications = notification; } else { notifications.add(notification); } } else { doAddUnique(size, object); } return notifications;
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: NotificationChain basicAdd(E, NotificationChain) Method name: NotificationChain basicAdd(E, NotificationChain)
Number of AST nodes: 10 Number of AST nodes: 10
1
if (isNotificationRequired())
1
if (isNotificationRequired())
2
    {
2
    {
3
      int index = size();
3
      int index = size;
4
      boolean oldIsSet = isSet();
4
      boolean oldIsSet = isSet();
5
      doAddUnique(index, object);
5
      doAddUnique(index, object);
6
      NotificationImpl notification = createNotification(Notification.ADD, null, object, index, oldIsSet);
6
      NotificationImpl notification = createNotification(Notification.ADD, null, object, index, oldIsSet);
7
      if (notifications == null)
7
      if (notifications == null)
8
      {
8
      {
9
        notifications = notification;
9
        notifications = notification;
10
      }
10
      }
11
      else
11
      else
12
      {
12
      {
13
        notifications.add(notification);
13
        notifications.add(notification);
14
      }
14
      }
15
    }
15
    }
16
    else
16
    else
17
    {
17
    {
18
      doAddUnique(size(), object);
18
      doAddUnique(size, object);
19
    }
19
    }
20
    return notifications;
20
    return notifications;
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.2
Clones locationClones are in different classes having the same super class
Number of node comparisons46
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements10
    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 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (isNotificationRequired())
    1
    if (isNotificationRequired())
    2
    int index = size();
    2
    int index = size();
    2
    int index = size;
    Differences
    Expression1Expression2Difference
    size()sizeTYPE_COMPATIBLE_REPLACEMENT
    2
    int index = size;
    3
    boolean oldIsSet = isSet();
    3
    boolean oldIsSet = isSet();
    4
    doAddUnique(index, object);
    4
    doAddUnique(index, object);
    5
    NotificationImpl notification = createNotification(Notification.ADD, null, object, index, oldIsSet);
    5
    NotificationImpl notification = createNotification(Notification.ADD, null, object, index, oldIsSet);
    6
    if (notifications == null)
    6
    if (notifications == null)
    7
    notifications = notification;
    7
    notifications = notification;
    else
    else
    8
    notifications.add(notification);
    8
    notifications.add(notification);
    else
    else
    9
    doAddUnique(size(), object);
    9
    doAddUnique(size(), object);
    9
    doAddUnique(size, object);
    Differences
    Expression1Expression2Difference
    size()sizeTYPE_COMPATIBLE_REPLACEMENT
    9
    doAddUnique(size, object);
    10
    return notifications;
    10
    return notifications;
    Precondition Violations (0)
    Row Violation