173-106-107

if (childrenReferences == null) { childrenReferences = new ArrayList<EReference>(); } return childrenReferences;
if (childrenFeatures == null) { childrenFeatures = new ArrayList<EStructuralFeature>(); } return childrenFeatures;

Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/edit/provider/ItemProviderAdapter.java |  | File path: /emf-2.4.1/src/org/eclipse/emf/edit/provider/ItemProviderAdapter.java
Method name: `Collection getChildrenReferences(Object)` |  | Method name: `Collection getChildrenFeatures(Object)`
Number of AST nodes: 3 |  | Number of AST nodes: 3

1

    if (childrenReferences == null)↵

1

    if (childrenFeatures == null)↵

2

        {↵

2

        {↵

3

          childrenReferences = new ArrayList<EReference>();↵

3

          childrenFeatures = new ArrayList<EStructuralFeature>();↵

4

        }↵

4

        }↵

5

        return childrenReferences;

5

        return childrenFeatures;

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.2
Clones location | Clones are declared in the same 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) | 1.4
   Clone type | Type 2

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

   1

       if (childrenReferences == null)

   1 | if (childrenReferences == null)
   1 | if (childrenFeatures == null)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   childrenReferences | childrenFeatures | VARIABLE_NAME_MISMATCH

   1

       if (childrenFeatures == null)

   2

       childrenReferences = new ArrayList<EReference>();

   2 | childrenReferences = new ArrayList<EReference>();
   2 | childrenFeatures = new ArrayList<EStructuralFeature>();

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   childrenReferences | childrenFeatures | VARIABLE_NAME_MISMATCH
   org.eclipse.emf.ecore.EReference | org.eclipse.emf.ecore.EStructuralFeature | SUBCLASS_TYPE_MISMATCH

   2

       childrenFeatures = new ArrayList<EStructuralFeature>();

   3

       return childrenReferences;

   3 | return childrenReferences;
   3 | return childrenFeatures;

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   childrenReferences | childrenFeatures | VARIABLE_NAME_MISMATCH

   3

       return childrenFeatures;

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