result = true; if (hasShadow()) { // Remove from by position in reverse order. // for (int i = 0; i < count; ++i) { @SuppressWarnings("unchecked") E object = (E)objects[i]; notifications = shadowRemove(object, notifications); } } // Remove from by position in reverse order. // for (int i = count; --i >= 0;) { doRemove(positions[i]); } // Compact the results to remove unmatched objects // if (count != listSize) { for (int i = listSize; --i >= count; ) { list.remove(i); } int [] oldPositions = positions; positions = new int [count]; System.arraycopy(oldPositions, 0, positions, 0, count); } collection = list;
result = true; if (hasShadow()) { // Remove from by position in reverse order. // for (int i = 0; i < count; ++i) { @SuppressWarnings("unchecked") E object = (E)objects[i]; notifications = shadowRemove(object, notifications); } } // Remove from by position in reverse order. // for (int i = count; --i >= 0;) { doRemove(positions[i]); } // Compact the results to remove unmatched objects // if (count != listSize) { for (int i = listSize; --i >= count; ) { list.remove(i); } int [] oldPositions = positions; positions = new int [count]; System.arraycopy(oldPositions, 0, positions, 0, count); } collection = list;
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: boolean removeAll(Collection) Method name: boolean removeAll(Collection)
Number of AST nodes: 14 Number of AST nodes: 14
1
result = true;
1
result = true;
2
          if (hasShadow())
2
          if (hasShadow())
3
          {
3
          {
4
            // Remove from by position in reverse order.
4
            // Remove from by position in reverse order.
5
            //
5
            //
6
            for (int i = 0; i < count; ++i)
6
            for (int i = 0; i < count; ++i)
7
            {
7
            {
8
              @SuppressWarnings("unchecked") E object = (E)objects[i];
8
              @SuppressWarnings("unchecked") E object = (E)objects[i];
9
              notifications = shadowRemove(object, notifications);
9
              notifications = shadowRemove(object, notifications);
10
            }
10
            }
11
          }
11
          }
12
          // Remove from by position in reverse order.
12
          // Remove from by position in reverse order.
13
          //
13
          //
14
          for (int i = count; --i >= 0;)
14
          for (int i = count; --i >= 0;)
15
          {
15
          {
16
            doRemove(positions[i]);
16
            doRemove(positions[i]);
17
          }
17
          }
18
          // Compact the results to remove unmatched objects
18
          // Compact the results to remove unmatched objects
19
          //
19
          //
20
          if (count != listSize)
20
          if (count != listSize)
21
          {
21
          {
22
            for (int i = listSize; --i >= count; )
22
            for (int i = listSize; --i >= count; )
23
            {
23
            {
24
              list.remove(i);
24
              list.remove(i);
25
            }
25
            }
26
            int [] oldPositions = positions;
26
            int [] oldPositions = positions;
27
            positions = new int [count];
27
            positions = new int [count];
28
            System.arraycopy(oldPositions, 0, positions, 0, count);
28
            System.arraycopy(oldPositions, 0, positions, 0, count);
29
          }
29
          }
30
          collection = list;
30
          collection = list;
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.9
Clones locationClones are in different classes having the same super class
Number of node comparisons68
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements14
    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.3
    Clone typeType 1
    Mapped Statements
    ID Statement ID Statement
    53
    result = true;
    53
    result = true;
    54
    if (hasShadow())
    54
    if (hasShadow())
    55
    for (int i = 0; i < count; ++i)
    55
    for (int i = 0; i < count; ++i)
    56
    @SuppressWarnings("unchecked") E object = (E)objects[i];
    56
    @SuppressWarnings("unchecked") E object = (E)objects[i];
    57
    notifications = shadowRemove(object, notifications);
    57
    notifications = shadowRemove(object, notifications);
    58
    for (int i = count; --i >= 0; )
    58
    for (int i = count; --i >= 0; )
    59
    doRemove(positions[i]);
    59
    doRemove(positions[i]);
    60
    if (count != listSize)
    60
    if (count != listSize)
    61
    for (int i = listSize; --i >= count; )
    61
    for (int i = listSize; --i >= count; )
    62
    list.remove(i);
    62
    list.remove(i);
    63
    int[] oldPositions = positions;
    63
    int[] oldPositions = positions;
    64
    positions = new int[count];
    64
    positions = new int[count];
    65
    System.arraycopy(oldPositions, 0, positions, 0, count);
    65
    System.arraycopy(oldPositions, 0, positions, 0, count);
    66
    collection = list;
    66
    collection = list;
    Precondition Violations (1)
    Row Violation
    1Clone fragment #1 returns variables result, positions, collection , while Clone fragment #2 returns variables result, positions, collection