173-4-176

if (itemPropertyDescriptors == null) { super.getPropertyDescriptors(object); addFeatureNamePropertyDescriptor(object); addDataValuePropertyDescriptor(object); addValuePropertyDescriptor(object); addFeaturePropertyDescriptor(object); addReferenceValuePropertyDescriptor(object); } return itemPropertyDescriptors;
if (childrenFeatures == null) { super.getChildrenFeatures(object); childrenFeatures.add(ChangePackage.Literals.CHANGE_DESCRIPTION__OBJECT_CHANGES); childrenFeatures.add(ChangePackage.Literals.CHANGE_DESCRIPTION__OBJECTS_TO_ATTACH); childrenFeatures.add(ChangePackage.Literals.CHANGE_DESCRIPTION__RESOURCE_CHANGES); } return childrenFeatures;

Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/change/provider/FeatureMapEntryItemProvider.java |  | File path: /emf-2.4.1/src/org/eclipse/emf/ecore/change/provider/ChangeDescriptionItemProvider.java
Method name: `List getPropertyDescriptors(Object)` |  | Method name: `Collection getChildrenFeatures(Object)`
Number of AST nodes: 8 |  | Number of AST nodes: 6

1

    if (itemPropertyDescriptors == null)↵

1

    if (childrenFeatures == null)↵

2

        {↵

2

        {↵

3

          super.getPropertyDescriptors(object);↵

3

          super.getChildrenFeatures(object);↵

4

          addFeatureNamePropertyDescriptor(object);↵

4

          ↵

5

          addDataValuePropertyDescriptor(object);↵

6

          addValuePropertyDescriptor(object);↵

7

          addFeaturePropertyDescriptor(object);↵

8

          addReferenceValuePropertyDescriptor(object);↵

9

        }↵

10

        return itemPropertyDescriptor↵

5

    childrenFeatures.add(ChangePackage.Literals.CHANGE_DESCRIPTION__OBJECT_CHANGES);↵

6

          childrenFeatures.add(ChangePackage.Literals.CHANGE_DESCRIPTION__OBJECTS_TO_ATTACH);↵

7

          childrenFeatures.add(ChangePackage.Literals.CHANGE_DESCRIPTION__RESOURCE_CHANGES);↵

8

        }↵

11

    s;

9

        return childrenFeatures;

See real code fragment |  | See real code fragment

Summary
Number of common nesting structure subtrees | 1
Number of refactorable cases | 1
Number of non-refactorable cases | 0
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 | 36

1. {Refactorable}

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

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

   1

       if (itemPropertyDescriptors == null)

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

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   itemPropertyDescriptors | childrenFeatures | VARIABLE_NAME_MISMATCH

   1

       if (childrenFeatures == null)

   2

       super.getChildrenFeatures(object);

   2

       super.getPropertyDescriptors(object);

   3

       childrenFeatures.add(ChangePackage.Literals.CHANGE_DESCRIPTION__OBJECT_CHANGES);

   3

       addFeatureNamePropertyDescriptor(object);

   4

       childrenFeatures.add(ChangePackage.Literals.CHANGE_DESCRIPTION__OBJECTS_TO_ATTACH);

   4

       addDataValuePropertyDescriptor(object);

   5

       childrenFeatures.add(ChangePackage.Literals.CHANGE_DESCRIPTION__RESOURCE_CHANGES);

   5

       addValuePropertyDescriptor(object);

   6

       addFeaturePropertyDescriptor(object);

   7

       addReferenceValuePropertyDescriptor(object);

   8

       return itemPropertyDescriptors;

   8 | return itemPropertyDescriptors;
   6 | return childrenFeatures;

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   itemPropertyDescriptors | childrenFeatures | VARIABLE_NAME_MISMATCH

   6

       return childrenFeatures;

   Precondition Violations (0)
   Row | Violation
   --- | ---