173-71-90

if (objectsToDetach == null) { objectsToDetach = new EObjectEList<EObject>(EObject.class, this, ChangePackage.CHANGE_DESCRIPTION__OBJECTS_TO_DETACH); } return objectsToDetach;
if (outputs == null) { outputs = new EObjectResolvingEList<EObject>(EObject.class, this, MappingPackage.MAPPING__OUTPUTS); } return outputs;

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/mapping/impl/MappingImpl.java
Method name: `EList getObjectsToDetachGen()` |  | Method name: `EList getOutputs()`
Number of AST nodes: 3 |  | Number of AST nodes: 3

1

    if (objectsToDetach == null)↵

1

    if (outputs == null)↵

2

        {↵

2

        {↵

3

          objectsToDetach = new EObjectEList<EObject>(EObject.class, this, ChangePackage.CHANGE_DESCRIPTION__OBJECTS_TO_DETACH);↵

3

          outputs = new EObjectResolvingEList<EObject>(EObject.class, this, MappingPackage.MAPPING__OUTPUTS);↵

4

        }↵

4

        }↵

5

        return objectsToDetach;

5

        return outputs;

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 having the same super class
Number of node comparisons | 5

1. {Non-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) | 0.7
   Clone type | Type 2

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

   1

       if (objectsToDetach == null)

   1 | if (objectsToDetach == null)
   1 | if (outputs == null)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   objectsToDetach | outputs | VARIABLE_NAME_MISMATCH

   1

       if (outputs == null)

   2

       objectsToDetach = new EObjectEList<EObject>(EObject.class, this, ChangePackage.CHANGE_DESCRIPTION__OBJECTS_TO_DETACH);

   2 | objectsToDetach = new EObjectEList<EObject>(EObject.class, this, ChangePackage.CHANGE_DESCRIPTION__OBJECTS_TO_DETACH);
   2 | outputs = new EObjectResolvingEList<EObject>(EObject.class, this, MappingPackage.MAPPING__OUTPUTS);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   objectsToDetach | outputs | VARIABLE_NAME_MISMATCH
   org.eclipse.emf.ecore.util.EObjectEList | org.eclipse.emf.ecore.util.EObjectResolvingEList | SUBCLASS_TYPE_MISMATCH
   org.eclipse.emf.ecore.change.ChangePackage | org.eclipse.emf.mapping.MappingPackage | VARIABLE_TYPE_MISMATCH
   CHANGE_DESCRIPTION__OBJECTS_TO_DETACH | MAPPING__OUTPUTS | VARIABLE_NAME_MISMATCH

   Preondition Violations
   Expression objectsToDetach is a field being modified, and thus it cannot be parameterized
   Expression outputs is a field being modified, and thus it cannot be parameterized

   Type org.eclipse.emf.ecore.change.ChangePackage of variable ChangePackage does not match with type org.eclipse.emf.mapping.MappingPackage of variable MappingPackage
   - Make classes org.eclipse.emf.ecore.change.ChangePackage and org.eclipse.emf.mapping.MappingPackage extend a common superclass

   2

       outputs = new EObjectResolvingEList<EObject>(EObject.class, this, MappingPackage.MAPPING__OUTPUTS);

   3

       return objectsToDetach;

   3 | return objectsToDetach;
   3 | return outputs;

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   objectsToDetach | outputs | VARIABLE_NAME_MISMATCH

   Preondition Violations
   Expression objectsToDetach cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression outputs cannot be parameterized, because it has dependencies to/from statements that will be extracted

   3

       return outputs;

   Precondition Violations (5)
   Row | Violation
   --- | ---
   1 | Expression objectsToDetach is a field being modified, and thus it cannot be parameterized
   2 | Expression outputs is a field being modified, and thus it cannot be parameterized
   3 | Type org.eclipse.emf.ecore.change.ChangePackage of variable ChangePackage does not match with type org.eclipse.emf.mapping.MappingPackage of variable MappingPackage
   4 | Expression objectsToDetach cannot be parameterized, because it has dependencies to/from statements that will be extracted
   5 | Expression outputs cannot be parameterized, because it has dependencies to/from statements that will be extracted