switch (featureID) { case Ecore2XMLPackage.XML_MAP__ID_ATTRIBUTE_NAME: setIDAttributeName(ID_ATTRIBUTE_NAME_EDEFAULT); return; case Ecore2XMLPackage.XML_MAP__ECORE_TO_XML_INFO: getEcoreToXMLInfo().clear(); return; case Ecore2XMLPackage.XML_MAP__NO_NAMESPACE_PACKAGE: setNoNamespacePackage((EPackage)null); return; } super.eUnset(featureID);
switch (featureID) { case TreePackage.TREE_NODE__PARENT: setParent((TreeNode)null); return; case TreePackage.TREE_NODE__CHILDREN: getChildren().clear(); return; case TreePackage.TREE_NODE__DATA: setData((EObject)null); return; } super.eUnset(featureID);
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/mapping/ecore2xml/impl/XMLMapImpl.java File path: /emf-2.4.1/src/org/eclipse/emf/edit/tree/impl/TreeNodeImpl.java
Method name: void eUnset(int) Method name: void eUnset(int)
Number of AST nodes: 11 Number of AST nodes: 11
1
switch (featureID)
1
switch (featureID)
2
    {
2
    {
3
      case Ecore2XMLPackage.XML_MAP__ID_ATTRIBUTE_NAME:
3
      case 
4
        setIDAttributeName(ID_ATTRIBUTE_NAME_EDEFAULT);
5
        return;
6
      case Ecore2XMLPackage.XML_MAP__ECORE_TO_XML_INFO:
7
        getEcoreToXMLInfo().clear();
8
        return;
9
      case Ecore2XMLPackage.XML_MAP__NO_NAMESPACE_PACKAGE:
10
        setNoNamespacePackage((EPackage
4
TreePackage.TREE_NODE__PARENT:
5
        setParent((TreeNode)null);
6
        return;
7
      case TreePackage.TREE_NODE__CHILDREN:
8
        getChildren().clear();
9
        return;
10
      case TreePackage.TREE_NODE__DATA:
11
)null);
11
        setData((EObject)null);
12
        return;
12
        return;
13
    }
13
    }
14
    super.eUnset(featureID);
14
    super.eUnset(featureID);
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 comparisons56
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements11
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)3.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    switch (featureID)
    1
    switch (featureID)
    2
    case Ecore2XMLPackage.XML_MAP__ID_ATTRIBUTE_NAME:
    2
    case Ecore2XMLPackage.XML_MAP__ID_ATTRIBUTE_NAME:
    5
    case TreePackage.TREE_NODE__CHILDREN:
    Differences
    Expression1Expression2Difference
    org.eclipse.emf.mapping.ecore2xml.Ecore2XMLPackageorg.eclipse.emf.edit.tree.TreePackageVARIABLE_TYPE_MISMATCH
    XML_MAP__ID_ATTRIBUTE_NAMETREE_NODE__CHILDRENVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.mapping.ecore2xml.Ecore2XMLPackage of variable Ecore2XMLPackage does not match with type org.eclipse.emf.edit.tree.TreePackage of variable TreePackage
    • Make classes org.eclipse.emf.mapping.ecore2xml.Ecore2XMLPackage and org.eclipse.emf.edit.tree.TreePackage extend a common superclass
    5
    case TreePackage.TREE_NODE__CHILDREN:
    3
    setIDAttributeName(ID_ATTRIBUTE_NAME_EDEFAULT);
    3
    setIDAttributeName(ID_ATTRIBUTE_NAME_EDEFAULT);
    6
    getChildren().clear();
    Differences
    Expression1Expression2Difference
    setIDAttributeNameclearMETHOD_INVOCATION_NAME_MISMATCH
    setIDAttributeName(ID_ATTRIBUTE_NAME_EDEFAULT)getChildren().clear()ARGUMENT_NUMBER_MISMATCH
    getChildren()MISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression setIDAttributeName(ID_ATTRIBUTE_NAME_EDEFAULT) is a void method call, and thus it cannot be parameterized
    Expression getChildren().clear() is a void method call, and thus it cannot be parameterized
    Expression setIDAttributeName(ID_ATTRIBUTE_NAME_EDEFAULT) is a void method call, and thus it cannot be parameterized
    Expression getChildren().clear() is a void method call, and thus it cannot be parameterized
    6
    getChildren().clear();
    4
    return;
    7
    return;
    5
    case Ecore2XMLPackage.XML_MAP__ECORE_TO_XML_INFO:
    5
    case Ecore2XMLPackage.XML_MAP__ECORE_TO_XML_INFO:
    2
    case TreePackage.TREE_NODE__PARENT:
    Differences
    Expression1Expression2Difference
    org.eclipse.emf.mapping.ecore2xml.Ecore2XMLPackageorg.eclipse.emf.edit.tree.TreePackageVARIABLE_TYPE_MISMATCH
    XML_MAP__ECORE_TO_XML_INFOTREE_NODE__PARENTVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.mapping.ecore2xml.Ecore2XMLPackage of variable Ecore2XMLPackage does not match with type org.eclipse.emf.edit.tree.TreePackage of variable TreePackage
    • Make classes org.eclipse.emf.mapping.ecore2xml.Ecore2XMLPackage and org.eclipse.emf.edit.tree.TreePackage extend a common superclass
    2
    case TreePackage.TREE_NODE__PARENT:
    6
    getEcoreToXMLInfo().clear();
    6
    getEcoreToXMLInfo().clear();
    3
    setParent((TreeNode)null);
    Differences
    Expression1Expression2Difference
    clearsetParentMETHOD_INVOCATION_NAME_MISMATCH
    getEcoreToXMLInfo().clear()setParent((TreeNode)null)ARGUMENT_NUMBER_MISMATCH
    getEcoreToXMLInfo()MISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression getEcoreToXMLInfo().clear() is a void method call, and thus it cannot be parameterized
    Expression setParent((TreeNode)null) is a void method call, and thus it cannot be parameterized
    Expression getEcoreToXMLInfo().clear() is a void method call, and thus it cannot be parameterized
    Expression setParent((TreeNode)null) is a void method call, and thus it cannot be parameterized
    3
    setParent((TreeNode)null);
    7
    return;
    4
    return;
    8
    case Ecore2XMLPackage.XML_MAP__NO_NAMESPACE_PACKAGE:
    8
    case Ecore2XMLPackage.XML_MAP__NO_NAMESPACE_PACKAGE:
    8
    case TreePackage.TREE_NODE__DATA:
    Differences
    Expression1Expression2Difference
    org.eclipse.emf.mapping.ecore2xml.Ecore2XMLPackageorg.eclipse.emf.edit.tree.TreePackageVARIABLE_TYPE_MISMATCH
    XML_MAP__NO_NAMESPACE_PACKAGETREE_NODE__DATAVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.mapping.ecore2xml.Ecore2XMLPackage of variable Ecore2XMLPackage does not match with type org.eclipse.emf.edit.tree.TreePackage of variable TreePackage
    • Make classes org.eclipse.emf.mapping.ecore2xml.Ecore2XMLPackage and org.eclipse.emf.edit.tree.TreePackage extend a common superclass
    8
    case TreePackage.TREE_NODE__DATA:
    9
    setNoNamespacePackage((EPackage)null);
    9
    setNoNamespacePackage((EPackage)null);
    9
    setData((EObject)null);
    Differences
    Expression1Expression2Difference
    setNoNamespacePackagesetDataMETHOD_INVOCATION_NAME_MISMATCH
    org.eclipse.emf.ecore.EPackageorg.eclipse.emf.ecore.EObjectVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression setNoNamespacePackage((EPackage)null) is a void method call, and thus it cannot be parameterized
    Expression setData((EObject)null) is a void method call, and thus it cannot be parameterized
    Type org.eclipse.emf.ecore.EPackage of variable (EPackage)null does not match with type org.eclipse.emf.ecore.EObject of variable (EObject)null
    • Make classes org.eclipse.emf.ecore.EPackage and org.eclipse.emf.ecore.EObject extend a common superclass
    9
    setData((EObject)null);
    10
    return;
    10
    return;
    11
    super.eUnset(featureID);
    11
    super.eUnset(featureID);
    Precondition Violations (14)
    Row Violation
    1Type org.eclipse.emf.mapping.ecore2xml.Ecore2XMLPackage of variable Ecore2XMLPackage does not match with type org.eclipse.emf.edit.tree.TreePackage of variable TreePackage
    2Expression setIDAttributeName(ID_ATTRIBUTE_NAME_EDEFAULT) is a void method call, and thus it cannot be parameterized
    3Expression getChildren().clear() is a void method call, and thus it cannot be parameterized
    4Expression setIDAttributeName(ID_ATTRIBUTE_NAME_EDEFAULT) is a void method call, and thus it cannot be parameterized
    5Expression getChildren().clear() is a void method call, and thus it cannot be parameterized
    6Type org.eclipse.emf.mapping.ecore2xml.Ecore2XMLPackage of variable Ecore2XMLPackage does not match with type org.eclipse.emf.edit.tree.TreePackage of variable TreePackage
    7Expression getEcoreToXMLInfo().clear() is a void method call, and thus it cannot be parameterized
    8Expression setParent((TreeNode)null) is a void method call, and thus it cannot be parameterized
    9Expression getEcoreToXMLInfo().clear() is a void method call, and thus it cannot be parameterized
    10Expression setParent((TreeNode)null) is a void method call, and thus it cannot be parameterized
    11Type org.eclipse.emf.mapping.ecore2xml.Ecore2XMLPackage of variable Ecore2XMLPackage does not match with type org.eclipse.emf.edit.tree.TreePackage of variable TreePackage
    12Expression setNoNamespacePackage((EPackage)null) is a void method call, and thus it cannot be parameterized
    13Expression setData((EObject)null) is a void method call, and thus it cannot be parameterized
    14Type org.eclipse.emf.ecore.EPackage of variable (EPackage)null does not match with type org.eclipse.emf.ecore.EObject of variable (EObject)null