EStructuralFeature feature = entry.getEStructuralFeature(); Object value = entry.getValue(); NotificationImpl notification = feature.isMany() ? createNotification (Notification.REMOVE, feature, value, null, indexOf(feature, value), true) : createNotification (feature.isUnsettable() ? Notification.UNSET : Notification.SET, feature, value, feature.getDefaultValue(), Notification.NO_INDEX, true); if (notifications != null) { notifications.add(notification); } else { notifications = notification; } return notifications;
EStructuralFeature feature = object.getEStructuralFeature(); Object value = object.getValue(); NotificationImpl notification = feature.isMany() ? createNotification (Notification.REMOVE, feature, value, null, indexOf(feature, value), true) : createNotification (feature.isUnsettable() ? Notification.UNSET : Notification.SET, feature, value, feature.getDefaultValue(), Notification.NO_INDEX, true); if (notifications != null) { notifications.add(notification); } else { notifications = notification; }
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 shadowRemove(FeatureMap.Entry.Internal, NotificationChain) Method name: NotificationChain shadowRemove(Entry, NotificationChain)
Number of AST nodes: 7 Number of AST nodes: 6
1
EStructuralFeature feature = entry.getEStructuralFeature();
1
EStructuralFeature feature = object.getEStructuralFeature();
2
    Object value = entry.getValue();
2
      Object value = object.getValue();
3
    NotificationImpl notification = 
3
      NotificationImpl notification = 
4
      feature.isMany() ?
4
        feature.isMany() ?
5
        createNotification
5
          createNotification
6
          (Notification.REMOVE,
6
            (Notification.REMOVE,
7
           feature,
7
             feature,
8
           value,
8
             value,
9
           null, 
9
             null, 
10
           indexOf(feature, value),
10
             indexOf(feature, value),
11
           true) :
11
             true) :
12
        createNotification
12
          createNotification
13
          (feature.isUnsettable() ? Notification.UNSET : Notification.SET, 
13
            (feature.isUnsettable() ? Notification.UNSET : Notification.SET, 
14
           feature,
14
             feature,
15
           value,
15
             value,
16
           feature.getDefaultValue(), 
16
             feature.getDefaultValue(), 
17
           Notification.NO_INDEX,
17
             Notification.NO_INDEX,
18
           true);
18
             true);
19
    if (notifications != null)
19
      if (notifications != null)
20
    {
20
      {
21
      notifications.add(notification);
21
        notifications.add(notification);
22
    }
22
    
23
  }
23
    else
24
      else
24
    {
25
      {
25
      notifications = notification;
26
        notifications = notification;
26
    }
27
    
27
    
28
    return notifications;
28
  }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.1
Clones locationClones are in different classes having the same super class
Number of node comparisons15
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements6
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1.7
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    EStructuralFeature feature = entry.getEStructuralFeature();
    1
    EStructuralFeature feature = entry.getEStructuralFeature();
    2
    EStructuralFeature feature = object.getEStructuralFeature();
    Differences
    Expression1Expression2Difference
    entryobjectVARIABLE_NAME_MISMATCH
    org.eclipse.emf.ecore.util.FeatureMap.Entry.Internalorg.eclipse.emf.ecore.util.FeatureMap.EntryVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.ecore.util.FeatureMap.Entry.Internal of variable entry does not match with type org.eclipse.emf.ecore.util.FeatureMap.Entry of variable object
    • Make classes org.eclipse.emf.ecore.util.FeatureMap.Entry.Internal and org.eclipse.emf.ecore.util.FeatureMap.Entry extend a common superclass
    2
    EStructuralFeature feature = object.getEStructuralFeature();
    2
    Object value = entry.getValue();
    2
    Object value = entry.getValue();
    3
    Object value = object.getValue();
    Differences
    Expression1Expression2Difference
    entryobjectVARIABLE_NAME_MISMATCH
    org.eclipse.emf.ecore.util.FeatureMap.Entry.Internalorg.eclipse.emf.ecore.util.FeatureMap.EntryVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.ecore.util.FeatureMap.Entry.Internal of variable entry does not match with type org.eclipse.emf.ecore.util.FeatureMap.Entry of variable object
    • Make classes org.eclipse.emf.ecore.util.FeatureMap.Entry.Internal and org.eclipse.emf.ecore.util.FeatureMap.Entry extend a common superclass
    3
    Object value = object.getValue();
    3
    NotificationImpl notification = feature.isMany() ? createNotification(Notification.REMOVE, feature, value, null, indexOf(feature, value), true) : createNotification(feature.isUnsettable() ? Notification.UNSET : Notification.SET, feature, value, feature.getDefaultValue(), Notification.NO_INDEX, true);
    4
    NotificationImpl notification = feature.isMany() ? createNotification(Notification.REMOVE, feature, value, null, indexOf(feature, value), true) : createNotification(feature.isUnsettable() ? Notification.UNSET : Notification.SET, feature, value, feature.getDefaultValue(), Notification.NO_INDEX, true);
    4
    if (notifications != null)
    5
    if (notifications != null)
    5
    notifications.add(notification);
    6
    notifications.add(notification);
    else
    else
    6
    notifications = notification;
    7
    notifications = notification;
    7
    return notifications;
                                                    
    Precondition Violations (2)
    Row Violation
    1Type org.eclipse.emf.ecore.util.FeatureMap.Entry.Internal of variable entry does not match with type org.eclipse.emf.ecore.util.FeatureMap.Entry of variable object
    2Type org.eclipse.emf.ecore.util.FeatureMap.Entry.Internal of variable entry does not match with type org.eclipse.emf.ecore.util.FeatureMap.Entry of variable object