173-115-195

if (children == null) { children = new EObjectContainmentWithInverseEList<TreeNode>(TreeNode.class, this, TreePackage.TREE_NODE__CHILDREN, TreePackage.TREE_NODE__PARENT); } return children;
if (referencedEPackageFilterToConvert == null) { referencedEPackageFilterToConvert = createReferencedEPackageFilterToConvert(); } return referencedEPackageFilterToConvert.filterReferencedEPackages(ePackages, referencedGenPackages);

Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/edit/tree/impl/TreeNodeImpl.java |  | File path: /emf-2.4.1/src/org/eclipse/emf/converter/ModelConverter.java
Method name: `EList getChildren()` |  | Method name: `List filterReferencedEPackagesToConvert(Collection, List)`
Number of AST nodes: 3 |  | Number of AST nodes: 3

1

    if (children == null)↵

1

    if (↵

2

        {↵

3

          children = new EObjectContainmentWithInverseEList<TreeNode>(TreeNode.class, this, TreePackage.TREE_NODE__CHILDREN, TreePackage.TREE_NODE__PARENT);↵

4

        }↵

5

        return children↵

2

    referencedEPackageFilterToConvert == null)↵

3

        {↵

4

          referencedEPackageFilterToConvert = createReferencedEPackageFilterToConvert();↵

5

        }↵

6

    ;

6

        return referencedEPackageFilterToConvert.filterReferencedEPackages(ePackages, referencedGenPackages);

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) | 2805.0
   Clone type | Type 2

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

   1

       if (children == null)

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

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   children | referencedEPackageFilterToConvert | VARIABLE_NAME_MISMATCH
   org.eclipse.emf.common.util.EList | org.eclipse.emf.converter.ModelConverter.ReferencedEPackageFilter | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type org.eclipse.emf.common.util.EList<org.eclipse.emf.edit.tree.TreeNode> of variable children does not match with type org.eclipse.emf.converter.ModelConverter.ReferencedEPackageFilter of variable referencedEPackageFilterToConvert
   - Make classes org.eclipse.emf.common.util.EList 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 or after the extracted code, because it has dependencies to/from statements that will be extracted

   2

       referencedEPackageFilterToConvert = createReferencedEPackageFilterToConvert();

   2

       children = new EObjectContainmentWithInverseEList<TreeNode>(TreeNode.class, this, TreePackage.TREE_NODE__CHILDREN, TreePackage.TREE_NODE__PARENT);

   2 | children = new EObjectContainmentWithInverseEList<TreeNode>(TreeNode.class, this, TreePackage.TREE_NODE__CHILDREN, TreePackage.TREE_NODE__PARENT);

   Preondition Violations
   Unmatched statement children=new EObjectContainmentWithInverseEList<TreeNode>(TreeNode.class,this,TreePackage.TREE_NODE__CHILDREN,TreePackage.TREE_NODE__PARENT); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted

   3

       return children;

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

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.eclipse.emf.common.util.EList | java.util.List | SUBCLASS_TYPE_MISMATCH
   children | referencedEPackageFilterToConvert.filterReferencedEPackages(ePackages,referencedGenPackages) | TYPE_COMPATIBLE_REPLACEMENT

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

   3

       return referencedEPackageFilterToConvert.filterReferencedEPackages(ePackages, referencedGenPackages);

   Precondition Violations (5)
   Row | Violation
   --- | ---
   1 | Type org.eclipse.emf.common.util.EList<org.eclipse.emf.edit.tree.TreeNode> of variable children does not match with type org.eclipse.emf.converter.ModelConverter.ReferencedEPackageFilter of variable referencedEPackageFilterToConvert
   2 | Unmatched statement referencedEPackageFilterToConvert=createReferencedEPackageFilterToConvert(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
   3 | Unmatched statement children=new EObjectContainmentWithInverseEList<TreeNode>(TreeNode.class,this,TreePackage.TREE_NODE__CHILDREN,TreePackage.TREE_NODE__PARENT); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
   4 | Expression children cannot be parameterized, because it has dependencies to/from statements that will be extracted
   5 | Expression referencedEPackageFilterToConvert.filterReferencedEPackages(ePackages,referencedGenPackages) cannot be parameterized, because it has dependencies to/from statements that will be extracted