173-2-165

if (itemPropertyDescriptors == null) { super.getPropertyDescriptors(object); addOrderedPropertyDescriptor(object); addUniquePropertyDescriptor(object); addLowerBoundPropertyDescriptor(object); addUpperBoundPropertyDescriptor(object); addManyPropertyDescriptor(object); addRequiredPropertyDescriptor(object); addETypePropertyDescriptor(object); } return itemPropertyDescriptors;
if (eTypeParameters == null) { eTypeParameters = new EObjectContainmentEList.Resolving<ETypeParameter>(ETypeParameter.class, this, EcorePackage.EOPERATION__ETYPE_PARAMETERS); } return eTypeParameters;

Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/provider/ETypedElementItemProvider.java |  | File path: /emf-2.4.1/src/org/eclipse/emf/ecore/impl/EOperationImpl.java
Method name: `List getPropertyDescriptors(Object)` |  | Method name: `EList getETypeParameters()`
Number of AST nodes: 10 |  | Number of AST nodes: 3

1

    if (itemPropertyDescriptors == null)↵

1

    if (eTypeParameters == null)↵

2

        {↵

2

        {↵

3

          super.getPropertyDescriptors(object);↵

3

          ↵

4

          addOrderedPropertyDescriptor(object);↵

5

          addUniquePropertyDescriptor(object);↵

6

          addLowerBoundPropertyDescriptor(object);↵

7

          addUpperBoundPropertyDescriptor(object);↵

8

          addManyPropertyDescriptor(object);↵

9

          addRequiredPropertyDescriptor(object);↵

10

          addETypePropertyDescriptor(object);↵

11

        }↵

12

        return itemPropertyDescripto↵

4

    eTypeParameters = new EObjectContainmentEList.Resolving<ETypeParameter>(ETypeParameter.class, this, EcorePackage.EOPERATION__ETYPE_PARAMETERS);↵

5

        }↵

13

    rs;

6

        return eTypeParameters;

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

1. {Non-refactorable}

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

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

   1

       if (itemPropertyDescriptors == null)

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

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   itemPropertyDescriptors | eTypeParameters | 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.ecore.ETypeParameter> of variable eTypeParameters
   - Make classes java.util.List and org.eclipse.emf.common.util.EList extend a common superclass

   1

       if (eTypeParameters == null)

   2 | eTypeParameters = new EObjectContainmentEList.Resolving<ETypeParameter>(ETypeParameter.class, this, EcorePackage.EOPERATION__ETYPE_PARAMETERS);

   Preondition Violations
   Unmatched statement eTypeParameters=new EObjectContainmentEList.Resolving<ETypeParameter>(ETypeParameter.class,this,EcorePackage.EOPERATION__ETYPE_PARAMETERS); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted

   2

       eTypeParameters = new EObjectContainmentEList.Resolving<ETypeParameter>(ETypeParameter.class, this, EcorePackage.EOPERATION__ETYPE_PARAMETERS);

   2

       super.getPropertyDescriptors(object);

   3

       addOrderedPropertyDescriptor(object);

   3 | addOrderedPropertyDescriptor(object);

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

   4

       addUniquePropertyDescriptor(object);

   4 | addUniquePropertyDescriptor(object);

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

   5

       addLowerBoundPropertyDescriptor(object);

   5 | addLowerBoundPropertyDescriptor(object);

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

   6

       addUpperBoundPropertyDescriptor(object);

   6 | addUpperBoundPropertyDescriptor(object);

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

   7

       addManyPropertyDescriptor(object);

   7 | addManyPropertyDescriptor(object);

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

   8

       addRequiredPropertyDescriptor(object);

   8 | addRequiredPropertyDescriptor(object);

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

   9

       addETypePropertyDescriptor(object);

   9 | addETypePropertyDescriptor(object);

   Preondition Violations
   Unmatched statement addETypePropertyDescriptor(object); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
   Unmatched statement addETypePropertyDescriptor(object); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted

   3 | return eTypeParameters;

   Preondition Violations
   Unmatched return eTypeParameters;

   3

       return eTypeParameters;

   10

       return itemPropertyDescriptors;

   10 | return itemPropertyDescriptors;

   Preondition Violations
   Unmatched return itemPropertyDescriptors;

   Precondition Violations (13)
   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.ecore.ETypeParameter> of variable eTypeParameters
   2 | Unmatched statement eTypeParameters=new EObjectContainmentEList.Resolving<ETypeParameter>(ETypeParameter.class,this,EcorePackage.EOPERATION__ETYPE_PARAMETERS); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
   3 | Unmatched statement addOrderedPropertyDescriptor(object); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
   4 | Unmatched statement addUniquePropertyDescriptor(object); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
   5 | Unmatched statement addLowerBoundPropertyDescriptor(object); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
   6 | Unmatched statement addUpperBoundPropertyDescriptor(object); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
   7 | Unmatched statement addManyPropertyDescriptor(object); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
   8 | Unmatched statement addRequiredPropertyDescriptor(object); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
   9 | Unmatched statement addETypePropertyDescriptor(object); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
   10 | Unmatched statement addETypePropertyDescriptor(object); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
   11 | Unmatched return eTypeParameters;
   12 | Unmatched return itemPropertyDescriptors;
   13 | The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero