EObject resolved = resolveProxy((EObject)object); if (resolved != object) { Entry oldObject = delegateGet(entryIndex); Entry entry = createEntry(feature, resolved); delegateSet(entryIndex, validate(entryIndex, entry)); didSet(entryIndex, entry, oldObject); if (isNotificationRequired()) { NotificationImpl notifications = createNotification (Notification.RESOLVE, entry.getEStructuralFeature(), object, resolved, index, false); notifications.add(createNotification(Notification.RESOLVE, oldObject, entry, index, false)); notifications.dispatch(); } return resolved; } return object;
EObject resolved = resolveProxy((EObject)object); if (resolved != object) { Entry oldObject = (Entry)data[entryIndex]; Entry entry = createEntry(feature, resolved); assign(entryIndex, validate(entryIndex, entry)); didSet(entryIndex, entry, oldObject); if (isNotificationRequired()) { NotificationImpl notifications = createNotification (Notification.RESOLVE, entry.getEStructuralFeature(), object, resolved, index, false); notifications.add(createNotification(Notification.RESOLVE, oldObject, entry, index, false)); notifications.dispatch(); } return resolved; } return object;
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/DelegatingFeatureMap.java File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/BasicFeatureMap.java
Method name: Object resolveProxy(EStructuralFeature, int, int, Object) Method name: Object resolveProxy(EStructuralFeature, int, int, Object)
Number of AST nodes: 12 Number of AST nodes: 12
1
EObject resolved = resolveProxy((EObject)object);
1
EObject resolved = resolveProxy((EObject)object);
2
    if (resolved != object)
2
    if (resolved != object)
3
    {
3
    {
4
      Entry oldObject = delegateGet(entryIndex);
4
      Entry oldObject = (Entry)data[entryIndex];
5
      Entry entry = createEntry(feature, resolved);
5
      Entry entry = createEntry(feature, resolved);
6
      delegateSet(entryIndex, validate(entryIndex, entry));
6
      assign(entryIndex, validate(entryIndex, entry));
7
      didSet(entryIndex, entry, oldObject);
7
      didSet(entryIndex, entry, oldObject);
8
      if (isNotificationRequired())
8
      if (isNotificationRequired())
9
      {
9
      {
10
        NotificationImpl notifications = 
10
        NotificationImpl notifications = 
11
          createNotification
11
          createNotification
12
            (Notification.RESOLVE, 
12
            (Notification.RESOLVE, 
13
             entry.getEStructuralFeature(), 
13
             entry.getEStructuralFeature(), 
14
             object,
14
             object,
15
             resolved,
15
             resolved,
16
             index,
16
             index,
17
             false);
17
             false);
18
        notifications.add(createNotification(Notification.RESOLVE, oldObject, entry, index, false));
18
        notifications.add(createNotification(Notification.RESOLVE, oldObject, entry, index, false));
19
        notifications.dispatch();
19
        notifications.dispatch();
20
      }
20
      }
21
      return resolved;
21
      return resolved;
22
    }
22
    }
23
    return object;
23
    return object;
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.2
Clones locationClones are in different classes having the same super class
Number of node comparisons56
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements12
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)3.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    EObject resolved = resolveProxy((EObject)object);
    1
    EObject resolved = resolveProxy((EObject)object);
    2
    if (resolved != object)
    2
    if (resolved != object)
    3
    Entry oldObject = delegateGet(entryIndex);
    3
    Entry oldObject = delegateGet(entryIndex);
    3
    Entry oldObject = (Entry)data[entryIndex];
    Differences
    Expression1Expression2Difference
    delegateGet(entryIndex)(Entry)data[entryIndex]TYPE_COMPATIBLE_REPLACEMENT
    3
    Entry oldObject = (Entry)data[entryIndex];
    4
    Entry entry = createEntry(feature, resolved);
    4
    Entry entry = createEntry(feature, resolved);
    5
    delegateSet(entryIndex, validate(entryIndex, entry));
    5
    delegateSet(entryIndex, validate(entryIndex, entry));
    5
    assign(entryIndex, validate(entryIndex, entry));
    Differences
    Expression1Expression2Difference
    delegateSetassignMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression delegateSet(entryIndex,validate(entryIndex,entry)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression assign(entryIndex,validate(entryIndex,entry)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5
    assign(entryIndex, validate(entryIndex, entry));
    6
    didSet(entryIndex, entry, oldObject);
    6
    didSet(entryIndex, entry, oldObject);
    7
    if (isNotificationRequired())
    7
    if (isNotificationRequired())
    8
    NotificationImpl notifications = createNotification(Notification.RESOLVE, entry.getEStructuralFeature(), object, resolved, index, false);
    8
    NotificationImpl notifications = createNotification(Notification.RESOLVE, entry.getEStructuralFeature(), object, resolved, index, false);
    9
    notifications.add(createNotification(Notification.RESOLVE, oldObject, entry, index, false));
    9
    notifications.add(createNotification(Notification.RESOLVE, oldObject, entry, index, false));
    10
    notifications.dispatch();
    10
    notifications.dispatch();
    11
    return resolved;
    11
    return resolved;
    12
    return object;
    12
    return object;
    Precondition Violations (2)
    Row Violation
    1Expression delegateSet(entryIndex,validate(entryIndex,entry)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression assign(entryIndex,validate(entryIndex,entry)) cannot be parameterized, because it has dependencies to/from statements that will be extracted