173-138-149

if (eAttributeItemProvider == null) { eAttributeItemProvider = new EAttributeItemProvider(this); } return eAttributeItemProvider;
if (mixed == null) { mixed = new BasicFeatureMap(this, XMLNamespacePackage.XML_NAMESPACE_DOCUMENT_ROOT__MIXED); } return mixed;

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/xml/namespace/impl/XMLNamespaceDocumentRootImpl.java
Method name: `Adapter createEAttributeAdapter()` |  | Method name: `FeatureMap getMixed()`
Number of AST nodes: 3 |  | Number of AST nodes: 3

1

    if (eAttributeItemProvider == null)↵

1

    if (↵

2

        {↵

3

          eAttributeItemProvider = new EAttributeItemProvider(this↵

2

    mixed == null)↵

3

        {↵

4

    );↵

4

          mixed = new BasicFeatureMap(this, XMLNamespacePackage.XML_NAMESPACE_DOCUMENT_ROOT__MIXED);↵

5

        }↵

5

        }↵

6

        return eAttributeItemProvider;

6

        return mixed;

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.3
   Clone type | Type 2

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

   1

       if (eAttributeItemProvider == null)

   1 | if (eAttributeItemProvider == null)
   1 | if (mixed == null)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   eAttributeItemProvider | mixed | VARIABLE_NAME_MISMATCH
   org.eclipse.emf.ecore.provider.EAttributeItemProvider | org.eclipse.emf.ecore.util.FeatureMap | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type org.eclipse.emf.ecore.provider.EAttributeItemProvider of variable eAttributeItemProvider does not match with type org.eclipse.emf.ecore.util.FeatureMap of variable mixed
   - Make classes org.eclipse.emf.ecore.provider.EAttributeItemProvider and org.eclipse.emf.ecore.util.FeatureMap extend a common superclass

   1

       if (mixed == null)

   2

       mixed = new BasicFeatureMap(this, XMLNamespacePackage.XML_NAMESPACE_DOCUMENT_ROOT__MIXED);

   2

       eAttributeItemProvider = new EAttributeItemProvider(this);

   3 | return mixed;

   Preondition Violations
   Unmatched return mixed;

   3

       return mixed;

   3

       return eAttributeItemProvider;

   3 | return eAttributeItemProvider;

   Preondition Violations
   Unmatched return eAttributeItemProvider;

   Precondition Violations (3)
   Row | Violation
   --- | ---
   1 | Type org.eclipse.emf.ecore.provider.EAttributeItemProvider of variable eAttributeItemProvider does not match with type org.eclipse.emf.ecore.util.FeatureMap of variable mixed
   2 | Unmatched return mixed;
   3 | Unmatched return eAttributeItemProvider;