173-35-39

if (childrenFeatures == null) { super.getChildrenFeatures(object); childrenFeatures.add(Ecore2XMLPackage.Literals.XML_MAP__ECORE_TO_XML_INFO); } return childrenFeatures;
if (childrenFeatures == null) { super.getChildrenFeatures(object); /* ResourceSet resourceSet = (ResourceSet)object; childrenFeatures.add(ResourcePackage.eINSTANCE.getResourceSet_Resources()); */ } return childrenFeatures;

Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/mapping/ecore2xml/provider/XMLMapItemProvider.java |  | File path: /emf-2.4.1/src/org/eclipse/emf/edit/provider/resource/ResourceSetItemProvider.java
Method name: `Collection getChildrenFeatures(Object)` |  | Method name: `Collection getChildrenFeatures(Object)`
Number of AST nodes: 4 |  | Number of AST nodes: 3

1

    if (childrenFeatures == null)↵

1

    if (childrenFeatures == null)↵

2

        {↵

2

        {↵

3

          super.getChildrenFeatures(object);↵

3

          super.getChildrenFeatures(object);↵

4

          childrenFeatures.add(Ecore2XMLPackage.Literals.XML_MAP__ECORE_TO_XML_INFO);↵

4

    /*↵

5

          ResourceSet resourceSet = (ResourceSet)object;↵

6

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

7

    */↵

5

        }↵

8

        }↵

6

        return childrenFeatures;

9

        return childrenFeatures;

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 having the same super class
Number of node comparisons | 7

1. {Non-refactorable}

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

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

   1

       if (childrenFeatures == null)

   1

       if (childrenFeatures == null)

   2

       super.getChildrenFeatures(object);

   2 | super.getChildrenFeatures(object);
   2 | super.getChildrenFeatures(object);

   Preondition Violations
   Super method call super.getChildrenFeatures(object); cannot be extracted from method
   Super method call super.getChildrenFeatures(object); cannot be extracted from method

   2

       super.getChildrenFeatures(object);

   3

       childrenFeatures.add(Ecore2XMLPackage.Literals.XML_MAP__ECORE_TO_XML_INFO);

   3 | childrenFeatures.add(Ecore2XMLPackage.Literals.XML_MAP__ECORE_TO_XML_INFO);

   Preondition Violations
   Unmatched statement childrenFeatures.add(Ecore2XMLPackage.Literals.XML_MAP__ECORE_TO_XML_INFO); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted

   4

       return childrenFeatures;

   3

       return childrenFeatures;

   Precondition Violations (3)
   Row | Violation
   --- | ---
   1 | Super method call super.getChildrenFeatures(object); cannot be extracted from method
   2 | Super method call super.getChildrenFeatures(object); cannot be extracted from method
   3 | Unmatched statement childrenFeatures.add(Ecore2XMLPackage.Literals.XML_MAP__ECORE_TO_XML_INFO); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted