173-155-166

if (eStructuralFeatures == null) { eStructuralFeatures = new EObjectContainmentWithInverseEList<EStructuralFeature>(EStructuralFeature.class, this, EcorePackage.ECLASS__ESTRUCTURAL_FEATURES, EcorePackage.ESTRUCTURAL_FEATURE__ECONTAINING_CLASS); } return eStructuralFeatures;
if (eParameters == null) { eParameters = new EObjectContainmentWithInverseEList<EParameter>(EParameter.class, this, EcorePackage.EOPERATION__EPARAMETERS, EcorePackage.EPARAMETER__EOPERATION); } return eParameters;

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

1

    if (eStructuralFeatures == null)↵

1

    if (eParameters == null)↵

2

        {↵

2

        {↵

3

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

3

          eParameters = new EObjectContainmentWithInverseEList<EParameter>(EParameter.class, this, EcorePackage.EOPERATION__EPARAMETERS, EcorePackage.EPARAMETER__EOPERATION);↵

4

        }↵

4

        }↵

5

        return eStructuralFeatures;

5

        return eParameters;

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.3
Clones location | Clones are in different classes having the same super class
Number of node comparisons | 5

1. {Refactorable}

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

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

   1

       if (eStructuralFeatures == null)

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

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   eStructuralFeatures | eParameters | VARIABLE_NAME_MISMATCH

   1

       if (eParameters == null)

   2

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

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

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   eStructuralFeatures | eParameters | VARIABLE_NAME_MISMATCH
   org.eclipse.emf.ecore.EStructuralFeature | org.eclipse.emf.ecore.EParameter | SUBCLASS_TYPE_MISMATCH
   EStructuralFeature.class | EParameter.class | LITERAL_VALUE_MISMATCH
   ECLASS__ESTRUCTURAL_FEATURES | EOPERATION__EPARAMETERS | VARIABLE_NAME_MISMATCH
   ESTRUCTURAL_FEATURE__ECONTAINING_CLASS | EPARAMETER__EOPERATION | VARIABLE_NAME_MISMATCH

   2

       eParameters = new EObjectContainmentWithInverseEList<EParameter>(EParameter.class, this, EcorePackage.EOPERATION__EPARAMETERS, EcorePackage.EPARAMETER__EOPERATION);

   3

       return eStructuralFeatures;

   3 | return eStructuralFeatures;
   3 | return eParameters;

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   eStructuralFeatures | eParameters | VARIABLE_NAME_MISMATCH

   3

       return eParameters;

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