if (nested == null) { nested = new EObjectContainmentWithInverseEList<MappingHelper>(MappingHelper.class, this, MappingPackage.MAPPING_HELPER__NESTED, MappingPackage.MAPPING_HELPER__NESTED_IN); } return nested;
if (children == null) { children = new EObjectContainmentWithInverseEList<TreeNode>(TreeNode.class, this, TreePackage.TREE_NODE__CHILDREN, TreePackage.TREE_NODE__PARENT); } return children;
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/mapping/impl/MappingHelperImpl.java File path: /emf-2.4.1/src/org/eclipse/emf/edit/tree/impl/TreeNodeImpl.java
Method name: EList getNested() Method name: EList getChildren()
Number of AST nodes: 3 Number of AST nodes: 3
1
if (nested == null)
1
if (children == null)
2
    {
2
    {
3
      nested = new EObjectContainmentWithInverseEList<MappingHelper>(MappingHelper.class, this, MappingPackage.MAPPING_HELPER__NESTED, MappingPackage.MAPPING_HELPER__NESTED_IN);
3
      children = new EObjectContainmentWithInverseEList<TreeNode>(TreeNode.class, this, TreePackage.TREE_NODE__CHILDREN, TreePackage.TREE_NODE__PARENT);
4
    }
4
    }
5
    return nested;
5
    return children;
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.1
Clones locationClones are in different classes having the same super class
Number of node comparisons5
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (nested == null)
    1
    if (nested == null)
    1
    if (children == null)
    Differences
    Expression1Expression2Difference
    nestedchildrenVARIABLE_NAME_MISMATCH
    1
    if (children == null)
    2
    nested = new EObjectContainmentWithInverseEList<MappingHelper>(MappingHelper.class, this, MappingPackage.MAPPING_HELPER__NESTED, MappingPackage.MAPPING_HELPER__NESTED_IN);
    2
    nested = new EObjectContainmentWithInverseEList<MappingHelper>(MappingHelper.class, this, MappingPackage.MAPPING_HELPER__NESTED, MappingPackage.MAPPING_HELPER__NESTED_IN);
    2
    children = new EObjectContainmentWithInverseEList<TreeNode>(TreeNode.class, this, TreePackage.TREE_NODE__CHILDREN, TreePackage.TREE_NODE__PARENT);
    Differences
    Expression1Expression2Difference
    nestedchildrenVARIABLE_NAME_MISMATCH
    org.eclipse.emf.mapping.MappingPackageorg.eclipse.emf.edit.tree.TreePackageVARIABLE_TYPE_MISMATCH
    MAPPING_HELPER__NESTEDTREE_NODE__CHILDRENVARIABLE_NAME_MISMATCH
    org.eclipse.emf.mapping.MappingPackageorg.eclipse.emf.edit.tree.TreePackageVARIABLE_TYPE_MISMATCH
    MAPPING_HELPER__NESTED_INTREE_NODE__PARENTVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression nested is a field being modified, and thus it cannot be parameterized
    Expression children is a field being modified, and thus it cannot be parameterized
    Type org.eclipse.emf.mapping.MappingPackage of variable MappingPackage does not match with type org.eclipse.emf.edit.tree.TreePackage of variable TreePackage
    • Make classes org.eclipse.emf.mapping.MappingPackage and org.eclipse.emf.edit.tree.TreePackage extend a common superclass
    Type org.eclipse.emf.mapping.MappingPackage of variable MappingPackage does not match with type org.eclipse.emf.edit.tree.TreePackage of variable TreePackage
    • Make classes org.eclipse.emf.mapping.MappingPackage and org.eclipse.emf.edit.tree.TreePackage extend a common superclass
    2
    children = new EObjectContainmentWithInverseEList<TreeNode>(TreeNode.class, this, TreePackage.TREE_NODE__CHILDREN, TreePackage.TREE_NODE__PARENT);
    3
    return nested;
    3
    return nested;
    3
    return children;
    Differences
    Expression1Expression2Difference
    nestedchildrenVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression nested cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression children cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3
    return children;
    Precondition Violations (6)
    Row Violation
    1Expression nested is a field being modified, and thus it cannot be parameterized
    2Expression children is a field being modified, and thus it cannot be parameterized
    3Type org.eclipse.emf.mapping.MappingPackage of variable MappingPackage does not match with type org.eclipse.emf.edit.tree.TreePackage of variable TreePackage
    4Type org.eclipse.emf.mapping.MappingPackage of variable MappingPackage does not match with type org.eclipse.emf.edit.tree.TreePackage of variable TreePackage
    5Expression nested cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression children cannot be parameterized, because it has dependencies to/from statements that will be extracted