if (match != null) { if (isNotificationRequired()) { NotificationImpl notification = feature.isMany() ? createNotification (Notification.REMOVE, feature, object, null, count, true) : createNotification (feature.isUnsettable() ? Notification.UNSET : Notification.SET, feature, object, feature.getDefaultValue(), Notification.NO_INDEX, true); if (notifications != null) { notifications.add(notification); } else { notifications = notification; } } notifications = basicRemove(match, notifications); }
if (match != null) { if (isNotificationRequired()) { @SuppressWarnings("null") NotificationImpl notification = feature.isMany() ? createNotification (Notification.REMOVE, feature, object, null, indexOf(feature, object), true) : createNotification (feature.isUnsettable() ? Notification.UNSET : Notification.SET, feature, object, feature.getDefaultValue(), Notification.NO_INDEX, true); if (notifications != null) { notifications.add(notification); } else { notifications = notification; } } notifications = basicRemove(match, notifications); }
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/BasicFeatureMap.java File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/DelegatingFeatureMap.java
Method name: NotificationChain basicRemove(EStructuralFeature, Object, NotificationChain) Method name: NotificationChain basicRemove(Object, NotificationChain)
Number of AST nodes: 7 Number of AST nodes: 7
1
if (match != null)
1
if (match != null)
2
    {
2
    
3
  {
3
      if (isNotificationRequired())
4
        if (isNotificationRequired())
4
      {
5
        {
6
          @SuppressWarnings("null")
5
        NotificationImpl notification = 
7
          NotificationImpl notification =
6
          feature.isMany() ?
8
            feature.isMany() ?
7
            createNotification
9
              createNotification
8
              (Notification.REMOVE,
10
                (Notification.REMOVE,
9
               feature,
11
                 feature,
10
               object,
12
                 object,
11
               null, 
13
                 null,
12
               count,
14
               
15
  indexOf(feature, object),
13
               true) :
16
                 true) :
14
            createNotification
17
              createNotification
15
              (feature.isUnsettable() ? Notification.UNSET : Notification.SET, 
18
                (feature.isUnsettable() ? Notification.UNSET : Notification.SET,
16
               feature,
19
                 feature,
17
               object,
20
                 object,
18
               feature.getDefaultValue(), 
21
                 feature.getDefaultValue(),
19
               Notification.NO_INDEX,
22
                 Notification.NO_INDEX,
20
               true);
23
                 true);
21
  
24
  
22
        if (notifications != null)
25
        if (notifications != null)
23
        {
26
          {
24
          notifications.add(notification);
27
            notifications.add(notification);
25
        }
28
          }
26
        else
29
          else
27
        {
30
        
31
  {
28
          notifications = notification;
32
            notifications = notification;
29
        }
33
          }
30
      }
34
        }
31
      notifications = basicRemove(match, notifications);
35
        notifications = basicRemove(match, notifications);
32
    }
36
      }
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 comparisons20
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements6
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)1.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    28
    if (match != null)
    12
    if (match != null)
    29
    if (isNotificationRequired())
    13
    if (isNotificationRequired())
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
    14
    @SuppressWarnings("null") NotificationImpl notification = feature.isMany() ? createNotification(Notification.REMOVE, feature, object, null, indexOf(feature, object), true) : createNotification(feature.isUnsettable() ? Notification.UNSET : Notification.SET, feature, object, feature.getDefaultValue(), Notification.NO_INDEX, true);
    30
    NotificationImpl notification = feature.isMany() ? createNotification(Notification.REMOVE, feature, object, null, count, true) : createNotification(feature.isUnsettable() ? Notification.UNSET : Notification.SET, feature, object, feature.getDefaultValue(), Notification.NO_INDEX, true);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
    31
    if (notifications != null)
    15
    if (notifications != null)
    32
    notifications.add(notification);
    16
    notifications.add(notification);
    else
    else
    33
    notifications = notification;
    17
    notifications = notification;
    34
    notifications = basicRemove(match, notifications);
    18
    notifications = basicRemove(match, notifications);
    Precondition Violations (0)
    Row Violation