173-152-161

if (eKeys == null) { eKeys = new EObjectResolvingEList<EAttribute>(EAttribute.class, this, EcorePackage.EREFERENCE__EKEYS); } return eKeys;
if (eSubpackages == null) { eSubpackages = new EObjectContainmentWithInverseEList.Resolving<EPackage>(EPackage.class, this, EcorePackage.EPACKAGE__ESUBPACKAGES, EcorePackage.EPACKAGE__ESUPER_PACKAGE); } return eSubpackages;

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

1

    if (eKeys == null)↵

1

    if (eSubpackages == null)↵

2

        {↵

2

        {↵

3

          eKeys = new EObjectResolvingEList<EAttribute>(EAttribute.class, this, EcorePackage.EREFERENCE__EKEYS);↵

3

          eSubpackages = new EObjectContainmentWithInverseEList.Resolving<EPackage>(EPackage.class, this, EcorePackage.EPACKAGE__ESUBPACKAGES, EcorePackage.EPACKAGE__ESUPER_PACKAGE);↵

4

        }↵

4

        }↵

5

        return eKeys;

5

        return eSubpackages;

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

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

   1

       if (eKeys == null)

   1 | if (eKeys == null)
   1 | if (eSubpackages == null)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   eKeys | eSubpackages | VARIABLE_NAME_MISMATCH

   1

       if (eSubpackages == null)

   2

       eKeys = new EObjectResolvingEList<EAttribute>(EAttribute.class, this, EcorePackage.EREFERENCE__EKEYS);

   2 | eKeys = new EObjectResolvingEList<EAttribute>(EAttribute.class, this, EcorePackage.EREFERENCE__EKEYS);
   2 | eSubpackages = new EObjectContainmentWithInverseEList.Resolving<EPackage>(EPackage.class, this, EcorePackage.EPACKAGE__ESUBPACKAGES, EcorePackage.EPACKAGE__ESUPER_PACKAGE);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   eKeys | eSubpackages | VARIABLE_NAME_MISMATCH
   org.eclipse.emf.ecore.util.EObjectResolvingEList | org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList.Resolving | SUBCLASS_TYPE_MISMATCH
   EObjectResolvingEList | EObjectContainmentWithInverseEList.Resolving | TYPE_COMPATIBLE_REPLACEMENT
   org.eclipse.emf.ecore.EAttribute | org.eclipse.emf.ecore.EPackage | SUBCLASS_TYPE_MISMATCH
   new EObjectResolvingEList(EAttribute.class,this,EcorePackage.EREFERENCE__EKEYS) | new EObjectContainmentWithInverseEList.Resolving(EPackage.class,this,EcorePackage.EPACKAGE__ESUBPACKAGES,EcorePackage.EPACKAGE__ESUPER_PACKAGE) | ARGUMENT_NUMBER_MISMATCH

   2

       eSubpackages = new EObjectContainmentWithInverseEList.Resolving<EPackage>(EPackage.class, this, EcorePackage.EPACKAGE__ESUBPACKAGES, EcorePackage.EPACKAGE__ESUPER_PACKAGE);

   3

       return eKeys;

   3 | return eKeys;
   3 | return eSubpackages;

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   eKeys | eSubpackages | VARIABLE_NAME_MISMATCH

   3

       return eSubpackages;

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