if (feature.isUnique()) { for (Object object : collection) { if (!contains(feature, object)) { Entry entry = createEntry(feature, object); if (!entryCollection.contains(entry)) { entryCollection.add(entry); } } } } else if (!isFeatureMap) { for (Object object : collection) { Entry entry = createEntry(feature, object); entryCollection.add(entry); } }
if (feature.isUnique()) { for (Object object : collection) { if (!contains(feature, object)) { Entry entry = createEntry(feature, object); if (!entryCollection.contains(entry)) { entryCollection.add(entry); } } } } else if (!isFeatureMap) { for (Object object : collection) { Entry entry = createEntry(feature, object); entryCollection.add(entry); } }
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: boolean addAll(EStructuralFeature, Collection) Method name: boolean addAll(EStructuralFeature, Collection)
Number of AST nodes: 10 Number of AST nodes: 10
1
if (feature.isUnique())
1
if (feature.isUnique())
2
      {
2
      {
3
        for (Object object : collection)
3
        for (Object object : collection)
4
        {
4
        {
5
          if (!contains(feature, object))
5
          if (!contains(feature, object))
6
          {
6
          {
7
            Entry entry = createEntry(feature, object);
7
            Entry entry = createEntry(feature, object);
8
            if (!entryCollection.contains(entry))
8
            if (!entryCollection.contains(entry))
9
            {
9
            {
10
              entryCollection.add(entry);
10
              entryCollection.add(entry);
11
            }
11
            }
12
          }
12
          }
13
        }
13
        }
14
      }
14
      }
15
      else if (!isFeatureMap)
15
      else if (!isFeatureMap)
16
      {
16
      {
17
        for (Object object : collection)
17
        for (Object object : collection)
18
        {
18
        {
19
          Entry entry = createEntry(feature, object);
19
          Entry entry = createEntry(feature, object);
20
          entryCollection.add(entry);
20
          entryCollection.add(entry);
21
        }
21
        }
22
      }
22
      }
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.4
Clones locationClones are in different classes having the same super class
Number of node comparisons12
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements4
    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.4
    Clone typeType 1
    Mapped Statements
    ID Statement ID Statement
    8
    if (!contains(feature, object))
    8
    if (!contains(feature, object))
    9
    Entry entry = createEntry(feature, object);
    9
    Entry entry = createEntry(feature, object);
    10
    if (!entryCollection.contains(entry))
    10
    if (!entryCollection.contains(entry))
    11
    entryCollection.add(entry);
    11
    entryCollection.add(entry);
    Precondition Violations (0)
    Row Violation