173-143-165

if (eObjectToExtensionMap == null) { eObjectToExtensionMap = new HashMap<EObject, AnyType>(); } return eObjectToExtensionMap;
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/xmi/impl/XMLResourceImpl.java |  | File path: /emf-2.4.1/src/org/eclipse/emf/ecore/impl/EOperationImpl.java
Method name: `Map getEObjectToExtensionMap()` |  | Method name: `EList getETypeParameters()`
Number of AST nodes: 3 |  | Number of AST nodes: 3

1

    if (eObjectToExtensionMap == null)↵

1

    if (eTypeParameters == null)↵

2

        {↵

2

        {↵

3

          eObjectToExtensionMap = new HashMap<EObject, AnyType>();↵

3

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

4

        }↵

4

        }↵

5

        return eObjectToExtensionMap;

5

        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 having the same super class
Number of node comparisons | 5

1. {Non-refactorable}

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

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

   1

       if (eObjectToExtensionMap == null)

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

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   eObjectToExtensionMap | eTypeParameters | VARIABLE_NAME_MISMATCH
   java.util.Map | org.eclipse.emf.common.util.EList | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type java.util.Map<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.xml.type.AnyType> of variable eObjectToExtensionMap does not match with type org.eclipse.emf.common.util.EList<org.eclipse.emf.ecore.ETypeParameter> of variable eTypeParameters
   - Make classes java.util.Map 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

       eObjectToExtensionMap = new HashMap<EObject, AnyType>();

   2 | eObjectToExtensionMap = new HashMap<EObject, AnyType>();

   Preondition Violations
   Unmatched statement eObjectToExtensionMap=new HashMap<EObject,AnyType>(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted

   3 | return eTypeParameters;

   Preondition Violations
   Unmatched return eTypeParameters;

   3

       return eTypeParameters;

   3

       return eObjectToExtensionMap;

   3 | return eObjectToExtensionMap;

   Preondition Violations
   Unmatched return eObjectToExtensionMap;

   Precondition Violations (6)
   Row | Violation
   --- | ---
   1 | Type java.util.Map<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.xml.type.AnyType> of variable eObjectToExtensionMap 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 eObjectToExtensionMap=new HashMap<EObject,AnyType>(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
   4 | Unmatched return eTypeParameters;
   5 | Unmatched return eObjectToExtensionMap;
   6 | The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero