173-41-168

if (childrenFeatures == null) { super.getChildrenFeatures(object); // Resource resource = (Resource)object; // childrenFeatures.add(ResourcePackage.eINSTANCE.getResource_Contents()); } return childrenFeatures;
if (eCrossReferences == null) { eCrossReferences = ECrossReferenceEList.createECrossReferenceEList(this); } return eCrossReferences;

Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/edit/provider/resource/ResourceItemProvider.java |  | File path: /emf-2.4.1/src/org/eclipse/emf/ecore/impl/FlatEObjectImpl.java
Method name: `Collection getChildrenFeatures(Object)` |  | Method name: `EList eCrossReferences()`
Number of AST nodes: 3 |  | Number of AST nodes: 3

1

    if (childrenFeatures == null)↵

1

    if (eCrossReferences == null)↵

2

        {↵

2

        {↵

3

          super.getChildrenFeatures(object);↵

3

          ↵

4

          // Resource resource = (Resource)object;↵

4

    eCrossReferences = ↵

5

          // childrenFeatures.add(ResourcePackage.eINSTANCE.getResource_Contents());↵

5

    ECrossReferenceEList.createECrossReferenceEList(this);↵

6

        }↵

6

        }↵

7

        return childrenFeatures;

7

        return eCrossReferences;

See real code fragment |  | See real code fragment

Summary
Number of common nesting structure subtrees | 1
Number of refactorable cases | 0
Number of non-refactorable cases | 1
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.1
Clones location | Clones are in different classes
Number of node comparisons | 5

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 2
   Number of unmapped statements in the first code fragment | 1
   Number of unmapped statements in the second code fragment | 1
   Time elapsed for statement mapping (ms) | 60.0
   Clone type | Type 2

   Mapped Statements
   ID | Statement |  | ID | Statement
   --- | --- | --- | --- | ---

   1

       if (childrenFeatures == null)

   1 | if (childrenFeatures == null)
   1 | if (eCrossReferences == null)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   childrenFeatures | eCrossReferences | VARIABLE_NAME_MISMATCH
   java.util.List | org.eclipse.emf.common.util.EList | SUBCLASS_TYPE_MISMATCH

   1

       if (eCrossReferences == null)

   2 | eCrossReferences = ECrossReferenceEList.createECrossReferenceEList(this);

   Preondition Violations
   Unmatched statement eCrossReferences=ECrossReferenceEList.createECrossReferenceEList(this); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted

   2

       eCrossReferences = ECrossReferenceEList.createECrossReferenceEList(this);

   2

       super.getChildrenFeatures(object);

   3

       return childrenFeatures;

   3 | return childrenFeatures;
   3 | return eCrossReferences;

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   childrenFeatures | eCrossReferences | VARIABLE_NAME_MISMATCH
   java.util.List | org.eclipse.emf.common.util.EList | SUBCLASS_TYPE_MISMATCH

   3

       return eCrossReferences;

   Precondition Violations (2)
   Row | Violation
   --- | ---
   1 | Unmatched statement eCrossReferences=ECrossReferenceEList.createECrossReferenceEList(this); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
   2 | The refactoring of the clones is infeasible, because classes org.eclipse.emf.edit.provider.resource.ResourceItemProvider and org.eclipse.emf.ecore.impl.FlatEObjectImpl do not have a common superclass