173-181-194

if (wrappers == null) { wrappers = new Disposable(); } wrappers.add(wrapper);
if (referencedEPackageFilterToConvert == null) { referencedEPackageFilterToConvert = createReferencedEPackageFilterToConvert(); } return referencedEPackageFilterToConvert.computeValidReferencedGenPackages();

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/converter/ModelConverter.java
Method name: `Object wrap(EObject, EStructuralFeature, Object, int)` |  | Method name: `List computeValidReferencedGenPackages()`
Number of AST nodes: 3 |  | Number of AST nodes: 3

1

    if (wrappers == null)↵

1

    if (referencedEPackageFilterToConvert == null)↵

2

          {↵

2

        {↵

3

            wrappers = new Disposable();↵

3

          referencedEPackageFilterToConvert = createReferencedEPackageFilterToConvert();↵

4

          }↵

4

        }↵

5

          wrappers.add(wrapper);

5

        return referencedEPackageFilterToConvert.computeValidReferencedGenPackages();

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
   --- | --- | --- | --- | ---

   12

       if (wrappers == null)

   12 | if (wrappers == null)
   1 | if (referencedEPackageFilterToConvert == null)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   wrappers | referencedEPackageFilterToConvert | VARIABLE_NAME_MISMATCH
   org.eclipse.emf.edit.provider.Disposable | org.eclipse.emf.converter.ModelConverter.ReferencedEPackageFilter | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type org.eclipse.emf.edit.provider.Disposable of variable wrappers does not match with type org.eclipse.emf.converter.ModelConverter.ReferencedEPackageFilter of variable referencedEPackageFilterToConvert
   - Make classes org.eclipse.emf.edit.provider.Disposable and org.eclipse.emf.converter.ModelConverter.ReferencedEPackageFilter extend a common superclass

   1

       if (referencedEPackageFilterToConvert == null)

   2 | referencedEPackageFilterToConvert = createReferencedEPackageFilterToConvert();

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

   2

       referencedEPackageFilterToConvert = createReferencedEPackageFilterToConvert();

   13

       wrappers = new Disposable();

   13 | wrappers = new Disposable();

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

   3 | return referencedEPackageFilterToConvert.computeValidReferencedGenPackages();

   Preondition Violations
   Unmatched return referencedEPackageFilterToConvert.computeValidReferencedGenPackages();

   3

       return referencedEPackageFilterToConvert.computeValidReferencedGenPackages();

   14

       wrappers.add(wrapper);

   Precondition Violations (5)
   Row | Violation
   --- | ---
   1 | Type org.eclipse.emf.edit.provider.Disposable of variable wrappers does not match with type org.eclipse.emf.converter.ModelConverter.ReferencedEPackageFilter of variable referencedEPackageFilterToConvert
   2 | Unmatched statement referencedEPackageFilterToConvert=createReferencedEPackageFilterToConvert(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
   3 | Unmatched statement wrappers=new Disposable(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
   4 | Unmatched return referencedEPackageFilterToConvert.computeValidReferencedGenPackages();
   5 | The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero