173-39-76

if (childrenFeatures == null) { super.getChildrenFeatures(object); /* ResourceSet resourceSet = (ResourceSet)object; childrenFeatures.add(ResourcePackage.eINSTANCE.getResourceSet_Resources()); */ } return childrenFeatures;
if (listChanges == null) { listChanges = new EObjectContainmentEList<ListChange>(ListChange.class, this, ChangePackage.FEATURE_CHANGE__LIST_CHANGES); } return listChanges;

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

1

    if (childrenFeatures == null)↵

1

    if (listChanges == null)↵

2

        {↵

2

        {↵

3

          super.getChildrenFeatures(object);↵

3

          ↵

4

    /*↵

5

          ResourceSet resourceSet = (ResourceSet)object;↵

6

          childrenFeatures.add(ResourcePackage.eINSTANCE.getResourceSet_Resources());↵

7

    */↵

4

    listChanges = new EObjectContainmentEList<ListChange>(ListChange.class, this, ChangePackage.FEATURE_CHANGE__LIST_CHANGES);↵

8

        }↵

5

        }↵

9

        return childrenFeatures;

6

        return listChanges;

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.2
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) | 61.0
   Clone type | Type 2

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

   1

       if (childrenFeatures == null)

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

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

   1

       if (listChanges == null)

   2 | listChanges = new EObjectContainmentEList<ListChange>(ListChange.class, this, ChangePackage.FEATURE_CHANGE__LIST_CHANGES);

   Preondition Violations
   Unmatched statement listChanges=new EObjectContainmentEList<ListChange>(ListChange.class,this,ChangePackage.FEATURE_CHANGE__LIST_CHANGES); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted

   2

       listChanges = new EObjectContainmentEList<ListChange>(ListChange.class, this, ChangePackage.FEATURE_CHANGE__LIST_CHANGES);

   2

       super.getChildrenFeatures(object);

   3

       return childrenFeatures;

   3 | return childrenFeatures;
   3 | return listChanges;

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

   3

       return listChanges;

   Precondition Violations (2)
   Row | Violation
   --- | ---
   1 | Unmatched statement listChanges=new EObjectContainmentEList<ListChange>(ListChange.class,this,ChangePackage.FEATURE_CHANGE__LIST_CHANGES); 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.ResourceSetItemProvider and org.eclipse.emf.ecore.change.impl.FeatureChangeImpl do not have a common superclass