173-12-155

if (itemPropertyDescriptors == null) { super.getPropertyDescriptors(object); addIDPropertyDescriptor(object); addEAttributeTypePropertyDescriptor(object); } return itemPropertyDescriptors;
if (eStructuralFeatures == null) { eStructuralFeatures = new EObjectContainmentWithInverseEList<EStructuralFeature>(EStructuralFeature.class, this, EcorePackage.ECLASS__ESTRUCTURAL_FEATURES, EcorePackage.ESTRUCTURAL_FEATURE__ECONTAINING_CLASS); } return eStructuralFeatures;

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

1

    if (itemPropertyDescriptors == null)↵

1

    if (eStructuralFeatures == null)↵

2

        {↵

2

        {↵

3

          super.getPropertyDescriptors(object);↵

3

          ↵

4

          addIDPropertyDescriptor(object);↵

5

          addEAttributeTypePropertyDescriptor(object);↵

6

        }↵

7

        return itemPropertyDescriptor↵

4

    eStructuralFeatures = new EObjectContainmentWithInverseEList<EStructuralFeature>(EStructuralFeature.class, this, EcorePackage.ECLASS__ESTRUCTURAL_FEATURES, EcorePackage.ESTRUCTURAL_FEATURE__ECONTAINING_CLASS);↵

5

        }↵

8

    s;

6

        return eStructuralFeatures;

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.3
Clones location | Clones are in different classes
Number of node comparisons | 9

1. {Non-refactorable}

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

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

   1

       if (itemPropertyDescriptors == null)

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

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

   1

       if (eStructuralFeatures == null)

   2 | eStructuralFeatures = new EObjectContainmentWithInverseEList<EStructuralFeature>(EStructuralFeature.class, this, EcorePackage.ECLASS__ESTRUCTURAL_FEATURES, EcorePackage.ESTRUCTURAL_FEATURE__ECONTAINING_CLASS);

   Preondition Violations
   Unmatched statement eStructuralFeatures=new EObjectContainmentWithInverseEList<EStructuralFeature>(EStructuralFeature.class,this,EcorePackage.ECLASS__ESTRUCTURAL_FEATURES,EcorePackage.ESTRUCTURAL_FEATURE__ECONTAINING_CLASS); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted

   2

       eStructuralFeatures = new EObjectContainmentWithInverseEList<EStructuralFeature>(EStructuralFeature.class, this, EcorePackage.ECLASS__ESTRUCTURAL_FEATURES, EcorePackage.ESTRUCTURAL_FEATURE__ECONTAINING_CLASS);

   2

       super.getPropertyDescriptors(object);

   3

       addIDPropertyDescriptor(object);

   3 | addIDPropertyDescriptor(object);

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

   4

       addEAttributeTypePropertyDescriptor(object);

   4 | addEAttributeTypePropertyDescriptor(object);

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

   3 | return eStructuralFeatures;

   Preondition Violations
   Unmatched return eStructuralFeatures;

   3

       return eStructuralFeatures;

   5

       return itemPropertyDescriptors;

   5 | return itemPropertyDescriptors;

   Preondition Violations
   Unmatched return itemPropertyDescriptors;

   Precondition Violations (7)
   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.EStructuralFeature> of variable eStructuralFeatures
   2 | Unmatched statement eStructuralFeatures=new EObjectContainmentWithInverseEList<EStructuralFeature>(EStructuralFeature.class,this,EcorePackage.ECLASS__ESTRUCTURAL_FEATURES,EcorePackage.ESTRUCTURAL_FEATURE__ECONTAINING_CLASS); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
   3 | Unmatched statement addIDPropertyDescriptor(object); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
   4 | Unmatched statement addEAttributeTypePropertyDescriptor(object); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
   5 | Unmatched return eStructuralFeatures;
   6 | Unmatched return itemPropertyDescriptors;
   7 | The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero