173-131-142

if (eObjectItemProvider == null) { eObjectItemProvider = new ReflectiveItemProvider(this); } return eObjectItemProvider;
if (eObjectToIDMap == null) { eObjectToIDMap = new HashMap<EObject, String>(); } return eObjectToIDMap;

Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/provider/EcoreItemProviderAdapterFactory.java |  | File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xmi/impl/XMLResourceImpl.java
Method name: `Adapter createEObjectAdapter()` |  | Method name: `Map getEObjectToIDMap()`
Number of AST nodes: 3 |  | Number of AST nodes: 3

1

    if (eObjectItemProvider == null)↵

1

    if (eObjectToIDMap == null)↵

2

        {↵

2

        {↵

3

          eObjectItemProvider = new ReflectiveItemProvider(this);↵

3

          eObjectToIDMap = new HashMap<EObject, String>();↵

4

        }↵

4

        }↵

5

        return eObjectItemProvider;

5

        return eObjectToIDMap;

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
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 (eObjectItemProvider == null)

   1 | if (eObjectItemProvider == null)
   1 | if (eObjectToIDMap == null)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   eObjectItemProvider | eObjectToIDMap | VARIABLE_NAME_MISMATCH
   org.eclipse.emf.edit.provider.ReflectiveItemProvider | java.util.Map | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type org.eclipse.emf.edit.provider.ReflectiveItemProvider of variable eObjectItemProvider does not match with type java.util.Map<org.eclipse.emf.ecore.EObject,java.lang.String> of variable eObjectToIDMap
   - Make classes org.eclipse.emf.edit.provider.ReflectiveItemProvider and java.util.Map extend a common superclass

   1

       if (eObjectToIDMap == null)

   2 | eObjectToIDMap = new HashMap<EObject, String>();

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

   2

       eObjectToIDMap = new HashMap<EObject, String>();

   2

       eObjectItemProvider = new ReflectiveItemProvider(this);

   2 | eObjectItemProvider = new ReflectiveItemProvider(this);

   Preondition Violations
   Unmatched statement eObjectItemProvider=new ReflectiveItemProvider(this); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted

   3 | return eObjectToIDMap;

   Preondition Violations
   Unmatched return eObjectToIDMap;

   3

       return eObjectToIDMap;

   3

       return eObjectItemProvider;

   3 | return eObjectItemProvider;

   Preondition Violations
   Unmatched return eObjectItemProvider;

   Precondition Violations (6)
   Row | Violation
   --- | ---
   1 | Type org.eclipse.emf.edit.provider.ReflectiveItemProvider of variable eObjectItemProvider does not match with type java.util.Map<org.eclipse.emf.ecore.EObject,java.lang.String> of variable eObjectToIDMap
   2 | Unmatched statement eObjectToIDMap=new HashMap<EObject,String>(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
   3 | Unmatched statement eObjectItemProvider=new ReflectiveItemProvider(this); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
   4 | Unmatched return eObjectToIDMap;
   5 | Unmatched return eObjectItemProvider;
   6 | The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero