173-5-89

if (itemPropertyDescriptors == null) { super.getPropertyDescriptors(object); addKindPropertyDescriptor(object); addIndexPropertyDescriptor(object); addMoveToIndexPropertyDescriptor(object); addValuesPropertyDescriptor(object); } return itemPropertyDescriptors;
if (nested == null) { nested = new EObjectContainmentWithInverseEList<MappingHelper>(MappingHelper.class, this, MappingPackage.MAPPING_HELPER__NESTED, MappingPackage.MAPPING_HELPER__NESTED_IN); } return nested;

Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/change/provider/ListChangeItemProvider.java |  | File path: /emf-2.4.1/src/org/eclipse/emf/mapping/impl/MappingHelperImpl.java
Method name: `List getPropertyDescriptors(Object)` |  | Method name: `EList getNested()`
Number of AST nodes: 7 |  | Number of AST nodes: 3

1

    if (itemPropertyDescriptors == null)↵

1

    if (↵

2

        {↵

3

          super.getPropertyDescriptors(object);↵

4

          addKindPropertyDescriptor(object);↵

5

          addIndexPropertyDescriptor(object);↵

6

          addMoveToIndexPropertyDescriptor(object);↵

7

          addValuesPropertyDescriptor(object);↵

8

        }↵

9

        return itemPropertyDescriptors↵

2

    nested == null)↵

3

        {↵

4

          nested = new EObjectContainmentWithInverseEList<MappingHelper>(MappingHelper.class, this, MappingPackage.MAPPING_HELPER__NESTED, MappingPackage.MAPPING_HELPER__NESTED_IN);↵

5

        }↵

10

    ;

6

        return nested;

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

1. {Non-refactorable}

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

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

   1

       if (itemPropertyDescriptors == null)

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

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   itemPropertyDescriptors | nested | VARIABLE_NAME_MISMATCH
   java.util.List | org.eclipse.emf.common.util.EList | VARIABLE_TYPE_MISMATCH

   Preondition Violations

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

   1

       if (nested == null)

   2 | nested = new EObjectContainmentWithInverseEList<MappingHelper>(MappingHelper.class, this, MappingPackage.MAPPING_HELPER__NESTED, MappingPackage.MAPPING_HELPER__NESTED_IN);

   Preondition Violations
   Unmatched statement nested=new EObjectContainmentWithInverseEList<MappingHelper>(MappingHelper.class,this,MappingPackage.MAPPING_HELPER__NESTED,MappingPackage.MAPPING_HELPER__NESTED_IN); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted

   2

       nested = new EObjectContainmentWithInverseEList<MappingHelper>(MappingHelper.class, this, MappingPackage.MAPPING_HELPER__NESTED, MappingPackage.MAPPING_HELPER__NESTED_IN);

   2

       super.getPropertyDescriptors(object);

   3

       addKindPropertyDescriptor(object);

   3 | addKindPropertyDescriptor(object);

   Preondition Violations
   Unmatched statement addKindPropertyDescriptor(object); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted

   4

       addIndexPropertyDescriptor(object);

   4 | addIndexPropertyDescriptor(object);

   Preondition Violations
   Unmatched statement addIndexPropertyDescriptor(object); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted

   5

       addMoveToIndexPropertyDescriptor(object);

   5 | addMoveToIndexPropertyDescriptor(object);

   Preondition Violations
   Unmatched statement addMoveToIndexPropertyDescriptor(object); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted

   6

       addValuesPropertyDescriptor(object);

   6 | addValuesPropertyDescriptor(object);

   Preondition Violations
   Unmatched statement addValuesPropertyDescriptor(object); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted

   3 | return nested;

   Preondition Violations
   Unmatched return nested;

   3

       return nested;

   7

       return itemPropertyDescriptors;

   7 | return itemPropertyDescriptors;

   Preondition Violations
   Unmatched return itemPropertyDescriptors;

   Precondition Violations (9)
   Row | Violation
   --- | ---
   1 | Type java.util.List<org.eclipse.emf.edit.provider.IItemPropertyDescriptor> of variable itemPropertyDescriptors does not match with type org.eclipse.emf.common.util.EList<org.eclipse.emf.mapping.MappingHelper> of variable nested
   2 | Unmatched statement nested=new EObjectContainmentWithInverseEList<MappingHelper>(MappingHelper.class,this,MappingPackage.MAPPING_HELPER__NESTED,MappingPackage.MAPPING_HELPER__NESTED_IN); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
   3 | Unmatched statement addKindPropertyDescriptor(object); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
   4 | Unmatched statement addIndexPropertyDescriptor(object); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
   5 | Unmatched statement addMoveToIndexPropertyDescriptor(object); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
   6 | Unmatched statement addValuesPropertyDescriptor(object); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
   7 | Unmatched return nested;
   8 | Unmatched return itemPropertyDescriptors;
   9 | The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero