Entry entry = delegateGet(i); if (validator.isValid(entry.getEStructuralFeature())) { if (!collection.contains(isFeatureMap ? entry : entry.getValue())) { entryCollection.add(entry); } }
Entry entry = entries[i]; if (validator.isValid(entry.getEStructuralFeature())) { if (!collection.contains(isFeatureMap ? entry : entry.getValue())) { entryCollection.add(entry); } }
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: boolean retainAll(EStructuralFeature, Collection) Method name: boolean retainAll(EStructuralFeature, Collection)
Number of AST nodes: 4 Number of AST nodes: 4
1
Entry entry = delegateGet(i);
1
Entry entry = entries[i];
2
      if (validator.isValid(entry.getEStructuralFeature()))
2
      if (validator.isValid(entry.getEStructuralFeature()))
3
      {
3
      {
4
        if (!collection.contains(isFeatureMap ? entry : entry.getValue()))
4
        if (!collection.contains(isFeatureMap ? entry : entry.getValue()))
5
        {
5
        {
6
          entryCollection.add(entry);
6
          entryCollection.add(entry);
7
        }
7
        }
8
      }
8
      }
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.4
Clones locationClones are in different classes having the same super class
Number of node comparisons7
  1. {Non-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)1.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    5
    Entry entry = delegateGet(i);
    5
    Entry entry = delegateGet(i);
    6
    Entry entry = entries[i];
    Differences
    Expression1Expression2Difference
    delegateGet(i)entries[i]TYPE_COMPATIBLE_REPLACEMENT
    6
    Entry entry = entries[i];
    6
    if (validator.isValid(entry.getEStructuralFeature()))
    7
    if (validator.isValid(entry.getEStructuralFeature()))
    7
    if (!collection.contains(isFeatureMap ? entry : entry.getValue()))
    7
    if (!collection.contains(isFeatureMap ? entry : entry.getValue()))
    8
    if (!collection.contains(isFeatureMap ? entry : entry.getValue()))
    Differences
    Expression1Expression2Difference
    java.util.Collection<>java.util.Collection<>VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.util.Collection<> of variable collection does not match with type java.util.Collection<> of variable collection
    • Make classes java.util.Collection<> and java.util.Collection<> extend a common superclass
    8
    if (!collection.contains(isFeatureMap ? entry : entry.getValue()))
    8
    entryCollection.add(entry);
    9
    entryCollection.add(entry);
    Precondition Violations (1)
    Row Violation
    1Type java.util.Collection<> of variable collection does not match with type java.util.Collection<> of variable collection