173-194-196

if (referencedEPackageFilterToConvert == null) { referencedEPackageFilterToConvert = createReferencedEPackageFilterToConvert(); } return referencedEPackageFilterToConvert.computeValidReferencedGenPackages();
if (referencedEPackageFilter == null) { referencedEPackageFilter = createReferencedEPackageFilter(); } return referencedEPackageFilter.filterReferencedEPackages(ePackages, referencedGenPackages);

Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/converter/ModelConverter.java |  | File path: /emf-2.4.1/src/org/eclipse/emf/converter/ModelConverter.java
Method name: `List computeValidReferencedGenPackages()` |  | Method name: `List filterReferencedEPackages(Collection, List)`
Number of AST nodes: 3 |  | Number of AST nodes: 3

1

    if (referencedEPackageFilterToConvert == null)↵

1

    if (referencedEPackageFilter == null)↵

2

        {↵

2

        {↵

3

          referencedEPackageFilterToConvert = createReferencedEPackageFilterToConvert();↵

3

          referencedEPackageFilter = createReferencedEPackageFilter();↵

4

        }↵

4

        }↵

5

        return referencedEPackageFilterToConvert.computeValidReferencedGenPackages();

5

        return referencedEPackageFilter.filterReferencedEPackages(ePackages, referencedGenPackages);

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.1
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) | 2704.6
   Clone type | Type 2

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

   1

       if (referencedEPackageFilterToConvert == null)

   1 | if (referencedEPackageFilterToConvert == null)
   1 | if (referencedEPackageFilter == null)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   referencedEPackageFilterToConvert | referencedEPackageFilter | VARIABLE_NAME_MISMATCH

   1

       if (referencedEPackageFilter == null)

   2

       referencedEPackageFilterToConvert = createReferencedEPackageFilterToConvert();

   2 | referencedEPackageFilterToConvert = createReferencedEPackageFilterToConvert();
   2 | referencedEPackageFilter = createReferencedEPackageFilter();

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   referencedEPackageFilterToConvert | referencedEPackageFilter | VARIABLE_NAME_MISMATCH
   createReferencedEPackageFilterToConvert | createReferencedEPackageFilter | METHOD_INVOCATION_NAME_MISMATCH

   2

       referencedEPackageFilter = createReferencedEPackageFilter();

   3

       return referencedEPackageFilterToConvert.computeValidReferencedGenPackages();

   3 | return referencedEPackageFilterToConvert.computeValidReferencedGenPackages();
   3 | return referencedEPackageFilter.filterReferencedEPackages(ePackages, referencedGenPackages);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   computeValidReferencedGenPackages | filterReferencedEPackages | METHOD_INVOCATION_NAME_MISMATCH
   referencedEPackageFilterToConvert | referencedEPackageFilter | VARIABLE_NAME_MISMATCH
   referencedEPackageFilterToConvert.computeValidReferencedGenPackages() | referencedEPackageFilter.filterReferencedEPackages(ePackages,referencedGenPackages) | ARGUMENT_NUMBER_MISMATCH

   Preondition Violations
   Expression referencedEPackageFilterToConvert.computeValidReferencedGenPackages() cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression referencedEPackageFilter.filterReferencedEPackages(ePackages,referencedGenPackages) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression referencedEPackageFilterToConvert.computeValidReferencedGenPackages() cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression referencedEPackageFilter.filterReferencedEPackages(ePackages,referencedGenPackages) cannot be parameterized, because it has dependencies to/from statements that will be extracted

   3

       return referencedEPackageFilter.filterReferencedEPackages(ePackages, referencedGenPackages);

   Precondition Violations (4)
   Row | Violation
   --- | ---
   1 | Expression referencedEPackageFilterToConvert.computeValidReferencedGenPackages() cannot be parameterized, because it has dependencies to/from statements that will be extracted
   2 | Expression referencedEPackageFilter.filterReferencedEPackages(ePackages,referencedGenPackages) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   3 | Expression referencedEPackageFilterToConvert.computeValidReferencedGenPackages() cannot be parameterized, because it has dependencies to/from statements that will be extracted
   4 | Expression referencedEPackageFilter.filterReferencedEPackages(ePackages,referencedGenPackages) cannot be parameterized, because it has dependencies to/from statements that will be extracted