173-65-194

if (objectChanges == null) { objectChanges = new EcoreEMap<EObject,EList<FeatureChange>>(ChangePackage.Literals.EOBJECT_TO_CHANGES_MAP_ENTRY, EObjectToChangesMapEntryImpl.class, this, ChangePackage.CHANGE_DESCRIPTION__OBJECT_CHANGES); } return objectChanges;
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/ecore/change/impl/ChangeDescriptionImpl.java |  | File path: /emf-2.4.1/src/org/eclipse/emf/converter/ModelConverter.java
Method name: `EMap> getObjectChanges()` |  | Method name: `List computeValidReferencedGenPackages()`
Number of AST nodes: 3 |  | Number of AST nodes: 3

1

    if (objectChanges == null)↵

1

    if (↵

2

        {↵

3

          objectChanges = new EcoreEMap<EObject,EList<FeatureChange>>(ChangePackage.Literals.EOBJECT_TO_CHANGES_MAP_ENTRY, EObjectToChangesMapEntryImpl.class, this, ChangePackage.CHANGE_DESCRIPTION__OBJECT_CHANGES);↵

4

        }↵

5

        return objectChan↵

2

    referencedEPackageFilterToConvert == null)↵

3

        {↵

4

          referencedEPackageFilterToConvert = createReferencedEPackageFilterToConvert();↵

5

        }↵

6

    ges;

6

        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.1
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 (objectChanges == null)

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

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   objectChanges | referencedEPackageFilterToConvert | VARIABLE_NAME_MISMATCH
   org.eclipse.emf.common.util.EMap> | org.eclipse.emf.converter.ModelConverter.ReferencedEPackageFilter | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type org.eclipse.emf.common.util.EMap<org.eclipse.emf.ecore.EObject,org.eclipse.emf.common.util.EList<org.eclipse.emf.ecore.change.FeatureChange>> of variable objectChanges does not match with type org.eclipse.emf.converter.ModelConverter.ReferencedEPackageFilter of variable referencedEPackageFilterToConvert
   - Make classes org.eclipse.emf.common.util.EMap> and org.eclipse.emf.converter.ModelConverter.ReferencedEPackageFilter extend a common superclass

   1

       if (referencedEPackageFilterToConvert == null)

   2

       referencedEPackageFilterToConvert = createReferencedEPackageFilterToConvert();

   2

       objectChanges = new EcoreEMap<EObject, EList<FeatureChange>>(ChangePackage.Literals.EOBJECT_TO_CHANGES_MAP_ENTRY, EObjectToChangesMapEntryImpl.class, this, ChangePackage.CHANGE_DESCRIPTION__OBJECT_CHANGES);

   3 | return referencedEPackageFilterToConvert.computeValidReferencedGenPackages();

   Preondition Violations
   Unmatched return referencedEPackageFilterToConvert.computeValidReferencedGenPackages();

   3

       return referencedEPackageFilterToConvert.computeValidReferencedGenPackages();

   3

       return objectChanges;

   3 | return objectChanges;

   Preondition Violations
   Unmatched return objectChanges;

   Precondition Violations (3)
   Row | Violation
   --- | ---
   1 | Type org.eclipse.emf.common.util.EMap<org.eclipse.emf.ecore.EObject,org.eclipse.emf.common.util.EList<org.eclipse.emf.ecore.change.FeatureChange>> of variable objectChanges does not match with type org.eclipse.emf.converter.ModelConverter.ReferencedEPackageFilter of variable referencedEPackageFilterToConvert
   2 | Unmatched return referencedEPackageFilterToConvert.computeValidReferencedGenPackages();
   3 | Unmatched return objectChanges;