173-1-176

if (itemPropertyDescriptors == null) { super.getPropertyDescriptors(object); addChangeablePropertyDescriptor(object); addVolatilePropertyDescriptor(object); addTransientPropertyDescriptor(object); addDefaultValueLiteralPropertyDescriptor(object); addDefaultValuePropertyDescriptor(object); addUnsettablePropertyDescriptor(object); addDerivedPropertyDescriptor(object); addEContainingClassPropertyDescriptor(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/provider/EStructuralFeatureItemProvider.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: 11 |  | Number of AST nodes: 6

1

    if (itemPropertyDescriptors == null)↵

1

    if (childrenFeatures == null)↵

2

        {↵

2

        {↵

3

          super.getPropertyDescriptors(object);↵

3

          super.get↵

4

          addChangeablePropertyDescriptor(object);↵

5

          addVolatilePropertyDescriptor(object);↵

6

          addTransientPropertyDescriptor(object);↵

7

          addDefaultValueLiteralPropertyDescriptor(object);↵

8

          addDefaultValuePropertyDescriptor(object);↵

9

          addUnsettablePropertyDescriptor(object);↵

10

          addDerivedPropertyDescriptor(object);↵

11

          addEContainingClassPropertyDescriptor(object);↵

12

        }↵

13

        return itemPropertyDescriptor↵

4

    ChildrenFeatures(object);↵

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

        }↵

14

    s;

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 | 51

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 2
   Number of unmapped statements in the first code fragment | 9
   Number of unmapped statements in the second code fragment | 4
   Time elapsed for statement mapping (ms) | 2.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
   java.util.List | java.util.List | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type java.util.List<org.eclipse.emf.edit.provider.IItemPropertyDescriptor> of variable itemPropertyDescriptors does not match with type java.util.List<org.eclipse.emf.ecore.EStructuralFeature> of variable childrenFeatures
   - Make classes java.util.List and java.util.List extend a common superclass

   1

       if (childrenFeatures == null)

   2

       super.getPropertyDescriptors(object);

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

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   getPropertyDescriptors | getChildrenFeatures | METHOD_INVOCATION_NAME_MISMATCH

   2

       super.getChildrenFeatures(object);

   3

       childrenFeatures.add(ChangePackage.Literals.CHANGE_DESCRIPTION__OBJECT_CHANGES);

   3

       addChangeablePropertyDescriptor(object);

   4

       childrenFeatures.add(ChangePackage.Literals.CHANGE_DESCRIPTION__OBJECTS_TO_ATTACH);

   4

       addVolatilePropertyDescriptor(object);

   5

       childrenFeatures.add(ChangePackage.Literals.CHANGE_DESCRIPTION__RESOURCE_CHANGES);

   5

       addTransientPropertyDescriptor(object);

   6

       addDefaultValueLiteralPropertyDescriptor(object);

   7

       addDefaultValuePropertyDescriptor(object);

   8

       addUnsettablePropertyDescriptor(object);

   9

       addDerivedPropertyDescriptor(object);

   10

       addEContainingClassPropertyDescriptor(object);

   6 | return childrenFeatures;

   Preondition Violations
   Unmatched return childrenFeatures;

   6

       return childrenFeatures;

   11

       return itemPropertyDescriptors;

   11 | return itemPropertyDescriptors;

   Preondition Violations
   Unmatched return itemPropertyDescriptors;

   Precondition Violations (3)
   Row | Violation
   --- | ---
   1 | Type java.util.List<org.eclipse.emf.edit.provider.IItemPropertyDescriptor> of variable itemPropertyDescriptors does not match with type java.util.List<org.eclipse.emf.ecore.EStructuralFeature> of variable childrenFeatures
   2 | Unmatched return childrenFeatures;
   3 | Unmatched return itemPropertyDescriptors;