173-116-155

if (contents == null) { contents = new ContentsEList<EObject>(); } return contents;
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/resource/impl/ResourceImpl.java |  | File path: /emf-2.4.1/src/org/eclipse/emf/ecore/impl/EClassImpl.java
Method name: `EList getContents()` |  | Method name: `EList getEStructuralFeatures()`
Number of AST nodes: 3 |  | Number of AST nodes: 3

1

    if (contents == null)↵

1

    if (eStructuralFeatures == null)↵

2

        {↵

2

        {↵

3

          contents = new ContentsEList<EObject>();↵

3

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

4

        }↵

4

        }↵

5

        return contents;

5

        return eStructuralFeatures;

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) | 19.2
   Clone type | Type 2

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

   1

       if (contents == null)

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

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   contents | eStructuralFeatures | VARIABLE_NAME_MISMATCH
   org.eclipse.emf.ecore.resource.impl.ResourceImpl.ContentsEList | org.eclipse.emf.common.util.EList | SUBCLASS_TYPE_MISMATCH

   1

       if (eStructuralFeatures == null)

   2

       contents = new ContentsEList<EObject>();

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

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   contents | eStructuralFeatures | VARIABLE_NAME_MISMATCH
   org.eclipse.emf.ecore.resource.impl.ResourceImpl.ContentsEList | org.eclipse.emf.common.util.EList | SUBCLASS_TYPE_MISMATCH
   org.eclipse.emf.ecore.resource.impl.ResourceImpl.ContentsEList | org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList | SUBCLASS_TYPE_MISMATCH
   org.eclipse.emf.ecore.EObject | org.eclipse.emf.ecore.EStructuralFeature | SUBCLASS_TYPE_MISMATCH
   new ContentsEList() | new EObjectContainmentWithInverseEList(EStructuralFeature.class,this,EcorePackage.ECLASS__ESTRUCTURAL_FEATURES,EcorePackage.ESTRUCTURAL_FEATURE__ECONTAINING_CLASS) | ARGUMENT_NUMBER_MISMATCH

   Preondition Violations
   Expression new EObjectContainmentWithInverseEList<EStructuralFeature>(EStructuralFeature.class,this,EcorePackage.ECLASS__ESTRUCTURAL_FEATURES,EcorePackage.ESTRUCTURAL_FEATURE__ECONTAINING_CLASS) cannot be parameterized, because it has dependencies to/from statements that will be extracted

   2

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

   3

       return contents;

   3 | return contents;
   3 | return eStructuralFeatures;

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   contents | eStructuralFeatures | VARIABLE_NAME_MISMATCH
   org.eclipse.emf.ecore.resource.impl.ResourceImpl.ContentsEList | org.eclipse.emf.common.util.EList | SUBCLASS_TYPE_MISMATCH

   3

       return eStructuralFeatures;

   Precondition Violations (1)
   Row | Violation
   --- | ---
   1 | Expression new EObjectContainmentWithInverseEList<EStructuralFeature>(EStructuralFeature.class,this,EcorePackage.ECLASS__ESTRUCTURAL_FEATURES,EcorePackage.ESTRUCTURAL_FEATURE__ECONTAINING_CLASS) cannot be parameterized, because it has dependencies to/from statements that will be extracted