if (isNotificationRequired()) { NotificationChain notifications = null; boolean oldIsSet = isSet(); if (hasShadow()) { notifications = shadowRemove(basicGet(index), null); } E oldObject; NotificationImpl notification = createNotification(Notification.REMOVE, oldObject = doRemove(index), null, index, oldIsSet); if (hasInverse() && oldObject != null) { notifications = inverseRemove(oldObject, notifications); if (notifications == null) { dispatchNotification(notification); } else { notifications.add(notification); notifications.dispatch(); } } else { if (notifications == null) { dispatchNotification(notification); } else { notifications.add(notification); notifications.dispatch(); } } return oldObject; } else { E oldObject = doRemove(index); if (hasInverse() && oldObject != null) { NotificationChain notifications = inverseRemove(oldObject, null); if (notifications != null) notifications.dispatch(); } return oldObject; }
if (isNotificationRequired()) { NotificationChain notifications = null; boolean oldIsSet = isSet(); if (hasShadow()) { notifications = shadowRemove(basicGet(index), null); } E oldObject; NotificationImpl notification = createNotification(Notification.REMOVE, oldObject = doRemove(index), null, index, oldIsSet); if (hasInverse() && oldObject != null) { notifications = inverseRemove(oldObject, notifications); if (notifications == null) { dispatchNotification(notification); } else { notifications.add(notification); notifications.dispatch(); } } else { if (notifications == null) { dispatchNotification(notification); } else { notifications.add(notification); notifications.dispatch(); } } return oldObject; } else { E oldObject = doRemove(index); if (hasInverse() && oldObject != null) { NotificationChain notifications = inverseRemove(oldObject, null); if (notifications != null) notifications.dispatch(); } return oldObject; }
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: E remove(int) Method name: E remove(int)
Number of AST nodes: 24 Number of AST nodes: 24
1
if (isNotificationRequired())
1
if (isNotificationRequired())
2
    {
2
    {
3
      NotificationChain notifications = null;
3
      NotificationChain notifications = null;
4
      boolean oldIsSet = isSet();
4
      boolean oldIsSet = isSet();
5
      if (hasShadow())
5
      if (hasShadow())
6
      {
6
      {
7
        notifications = shadowRemove(basicGet(index), null);
7
        notifications = shadowRemove(basicGet(index), null);
8
      }
8
      }
9
      E oldObject;
9
      E oldObject;
10
      NotificationImpl notification = createNotification(Notification.REMOVE, oldObject = doRemove(index), null, index, oldIsSet);
10
      NotificationImpl notification = createNotification(Notification.REMOVE, oldObject = doRemove(index), null, index, oldIsSet);
11
      if (hasInverse() && oldObject != null)
11
      if (hasInverse() && oldObject != null)
12
      {
12
      {
13
        notifications = inverseRemove(oldObject, notifications);
13
        notifications = inverseRemove(oldObject, notifications);
14
        if (notifications == null)
14
        if (notifications == null)
15
        {
15
        {
16
          dispatchNotification(notification);
16
          dispatchNotification(notification);
17
        }
17
        }
18
        else
18
        else
19
        {
19
        {
20
          notifications.add(notification);
20
          notifications.add(notification);
21
          notifications.dispatch();
21
          notifications.dispatch();
22
        }
22
        }
23
      }
23
      }
24
      else
24
      else
25
      {
25
      {
26
        if (notifications == null)
26
        if (notifications == null)
27
        {
27
        {
28
          dispatchNotification(notification);
28
          dispatchNotification(notification);
29
        }
29
        }
30
        else
30
        else
31
        {
31
        {
32
          notifications.add(notification);
32
          notifications.add(notification);
33
          notifications.dispatch();
33
          notifications.dispatch();
34
        }
34
        }
35
      }
35
      }
36
      return oldObject;
36
      return oldObject;
37
    }
37
    }
38
    else
38
    else
39
    {
39
    {
40
      E oldObject = doRemove(index);
40
      E oldObject = doRemove(index);
41
      if (hasInverse() && oldObject != null)
41
      if (hasInverse() && oldObject != null)
42
      {
42
      {
43
        NotificationChain notifications = inverseRemove(oldObject, null);
43
        NotificationChain notifications = inverseRemove(oldObject, null);
44
        if (notifications != null) notifications.dispatch();
44
        if (notifications != null) notifications.dispatch();
45
      }
45
      }
46
      return oldObject;
46
      return oldObject;
47
    }
47
    }
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)1.1
Clones locationClones are in different classes having the same super class
Number of node comparisons147
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements24
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)4.9
    Clone typeType 1
    Mapped Statements
    ID Statement ID Statement
    1
    if (isNotificationRequired())
    1
    if (isNotificationRequired())
    2
    NotificationChain notifications = null;
    2
    NotificationChain notifications = null;
    3
    boolean oldIsSet = isSet();
    3
    boolean oldIsSet = isSet();
    4
    if (hasShadow())
    4
    if (hasShadow())
    5
    notifications = shadowRemove(basicGet(index), null);
    5
    notifications = shadowRemove(basicGet(index), null);
    6
    E oldObject;
    6
    E oldObject;
    7
    NotificationImpl notification = createNotification(Notification.REMOVE, oldObject = doRemove(index), null, index, oldIsSet);
    7
    NotificationImpl notification = createNotification(Notification.REMOVE, oldObject = doRemove(index), null, index, oldIsSet);
    8
    if (hasInverse() && oldObject != null)
    8
    if (hasInverse() && oldObject != null)
    9
    notifications = inverseRemove(oldObject, notifications);
    9
    notifications = inverseRemove(oldObject, notifications);
    10
    if (notifications == null)
    10
    if (notifications == null)
    11
    dispatchNotification(notification);
    11
    dispatchNotification(notification);
    else
    else
    12
    notifications.add(notification);
    12
    notifications.add(notification);
    13
    notifications.dispatch();
    13
    notifications.dispatch();
    else
    else
    14
    if (notifications == null)
    14
    if (notifications == null)
    15
    dispatchNotification(notification);
    15
    dispatchNotification(notification);
    else
    else
    16
    notifications.add(notification);
    16
    notifications.add(notification);
    17
    notifications.dispatch();
    17
    notifications.dispatch();
    18
    return oldObject;
    18
    return oldObject;
    else
    else
    19
    E oldObject = doRemove(index);
    19
    E oldObject = doRemove(index);
    20
    if (hasInverse() && oldObject != null)
    20
    if (hasInverse() && oldObject != null)
    21
    NotificationChain notifications = inverseRemove(oldObject, null);
    21
    NotificationChain notifications = inverseRemove(oldObject, null);
    22
    if (notifications != null)
    22
    if (notifications != null)
    23
    notifications.dispatch();
    23
    notifications.dispatch();
    24
    return oldObject;
    24
    return oldObject;
    Precondition Violations (0)
    Row Violation