173-137-180

if (eAnnotationItemProvider == null) { eAnnotationItemProvider = new EAnnotationItemProvider(this); } return eAnnotationItemProvider;
if (changeNotifier == null) { changeNotifier = new ChangeNotifier(); } changeNotifier.addListener(listener);

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/edit/provider/ItemProviderDecorator.java
Method name: `Adapter createEAnnotationAdapter()` |  | Method name: `void addListener(INotifyChangedListener)`
Number of AST nodes: 3 |  | Number of AST nodes: 3

1

    if (eAnnotationItemProvider == null)↵

1

    if (changeNotifier == null)↵

2

        {↵

2

        {↵

3

          eAnnotationItemProvider = new EAnnotationItemProvider(this);↵

3

          changeNotifier = new ChangeNotifier();↵

4

        }↵

4

        }↵

5

        return eAnnotationItemProvider;

5

        changeNotifier.addListener(listener);

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 | 2
   Number of unmapped statements in the first code fragment | 1
   Number of unmapped statements in the second code fragment | 1
   Time elapsed for statement mapping (ms) | 58.0
   Clone type | Type 2

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

   1

       if (eAnnotationItemProvider == null)

   1 | if (eAnnotationItemProvider == null)
   1 | if (changeNotifier == null)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   eAnnotationItemProvider | changeNotifier | VARIABLE_NAME_MISMATCH
   org.eclipse.emf.ecore.provider.EAnnotationItemProvider | org.eclipse.emf.edit.provider.IChangeNotifier | SUBCLASS_TYPE_MISMATCH

   1

       if (changeNotifier == null)

   2

       eAnnotationItemProvider = new EAnnotationItemProvider(this);

   2 | eAnnotationItemProvider = new EAnnotationItemProvider(this);
   2 | changeNotifier = new ChangeNotifier();

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   eAnnotationItemProvider | changeNotifier | VARIABLE_NAME_MISMATCH
   org.eclipse.emf.ecore.provider.EAnnotationItemProvider | org.eclipse.emf.edit.provider.IChangeNotifier | SUBCLASS_TYPE_MISMATCH
   org.eclipse.emf.ecore.provider.EAnnotationItemProvider | org.eclipse.emf.edit.provider.ChangeNotifier | SUBCLASS_TYPE_MISMATCH
   new EAnnotationItemProvider(this) | new ChangeNotifier() | ARGUMENT_NUMBER_MISMATCH

   2

       changeNotifier = new ChangeNotifier();

   3 | changeNotifier.addListener(listener);

   Preondition Violations
   Unmatched statement changeNotifier.addListener(listener); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted

   3

       changeNotifier.addListener(listener);

   3

       return eAnnotationItemProvider;

   Precondition Violations (1)
   Row | Violation
   --- | ---
   1 | Unmatched statement changeNotifier.addListener(listener); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted