NotificationChain notifications = inverseAdd(object, null); if (hasShadow()) { notifications = shadowAdd(object, notifications); } if (notifications == null) { dispatchNotification(notification); } else { notifications.add(notification); notifications.dispatch(); }
NotificationChain notifications = inverseAdd(object, null); if (hasShadow()) { notifications = shadowAdd(object, 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/DelegatingNotifyingListImpl.java
Method name: void addUnique(E) Method name: void addUnique(int, E)
Number of AST nodes: 7 Number of AST nodes: 7
1
NotificationChain notifications = inverseAdd(object, null);
1
NotificationChain notifications = inverseAdd(object, null);
2
        if (hasShadow())
2
        if (hasShadow())
3
        {
3
        {
4
          notifications = shadowAdd(object, notifications);
4
          notifications = shadowAdd(object, notifications);
5
        }
5
        }
6
        if (notifications == null)
6
        if (notifications == null)
7
        {
7
        {
8
          dispatchNotification(notification);
8
          dispatchNotification(notification);
9
        }
9
        }
10
        else
10
        else
11
        {
11
        {
12
          notifications.add(notification);
12
          notifications.add(notification);
13
          notifications.dispatch();
13
          notifications.dispatch();
14
        }
14
        }
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 declared in the same class
Number of node comparisons31
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements7
    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.0
    Clone typeType 1
    Mapped Statements
    ID Statement ID Statement
    7
    NotificationChain notifications = inverseAdd(object, null);
    6
    NotificationChain notifications = inverseAdd(object, null);
    8
    if (hasShadow())
    7
    if (hasShadow())
    9
    notifications = shadowAdd(object, notifications);
    8
    notifications = shadowAdd(object, notifications);
    10
    if (notifications == null)
    9
    if (notifications == null)
    11
    dispatchNotification(notification);
    10
    dispatchNotification(notification);
    else
    else
    12
    notifications.add(notification);
    11
    notifications.add(notification);
    13
    notifications.dispatch();
    12
    notifications.dispatch();
    Precondition Violations (0)
    Row Violation