switch (featureID) { case TreePackage.TREE_NODE__PARENT: setParent((TreeNode)newValue); return; case TreePackage.TREE_NODE__CHILDREN: getChildren().clear(); getChildren().addAll((Collection<? extends TreeNode>)newValue); return; case TreePackage.TREE_NODE__DATA: setData((EObject)newValue); return; } super.eSet(featureID, newValue);
switch (featureID) { case Ecore2XMLPackage.XML_MAP__ID_ATTRIBUTE_NAME: setIDAttributeName((String)newValue); return; case Ecore2XMLPackage.XML_MAP__ECORE_TO_XML_INFO: ((EStructuralFeature.Setting)getEcoreToXMLInfo()).set(newValue); return; case Ecore2XMLPackage.XML_MAP__NO_NAMESPACE_PACKAGE: setNoNamespacePackage((EPackage)newValue); return; } super.eSet(featureID, newValue);
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/mapping/ecore2xml/impl/XMLMapImpl.java
Method name: void eSet(int, Object) Method name: void eSet(int, Object)
Number of AST nodes: 12 Number of AST nodes: 11
1
switch (featureID)
1
switch (featureID)
2
    {
2
    {
3
      case TreePackage.TREE_NODE__PARENT:
3
      case 
4
        setParent((TreeNode
4
Ecore2XMLPackage.XML_MAP__ID_ATTRIBUTE_NAME:
5
)newValue);
5
        setIDAttributeName((String)newValue);
6
        return;
6
        return;
7
      case TreePackage.TREE_NODE__CHILDREN:
7
      case 
8
        getChildren().clear();
9
        getChildren().addAll((Collection<? extends TreeNode>)newValue);
10
        return;
11
      case TreePackage.TREE_NODE__DATA:
12
        setData((EObject
8
Ecore2XMLPackage.XML_MAP__ECORE_TO_XML_INFO:
9
        ((EStructuralFeature.Setting)getEcoreToXMLInfo()).set(newValue);
10
        return;
11
      case Ecore2XMLPackage.XML_MAP__NO_NAMESPACE_PACKAGE:
13
)newValue);
12
        setNoNamespacePackage((EPackage)newValue);
14
        return;
13
        return;
15
    }
14
    }
16
    super.eSet(featureID, newValue);
15
    super.eSet(featureID, newValue);
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 comparisons62
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements10
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)2.8
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    switch (featureID)
    1
    switch (featureID)
    2
    case TreePackage.TREE_NODE__PARENT:
    2
    case TreePackage.TREE_NODE__PARENT:
    2
    case Ecore2XMLPackage.XML_MAP__ID_ATTRIBUTE_NAME:
    Differences
    Expression1Expression2Difference
    org.eclipse.emf.edit.tree.TreePackageorg.eclipse.emf.mapping.ecore2xml.Ecore2XMLPackageVARIABLE_TYPE_MISMATCH
    TREE_NODE__PARENTXML_MAP__ID_ATTRIBUTE_NAMEVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.edit.tree.TreePackage of variable TreePackage does not match with type org.eclipse.emf.mapping.ecore2xml.Ecore2XMLPackage of variable Ecore2XMLPackage
    • Make classes org.eclipse.emf.edit.tree.TreePackage and org.eclipse.emf.mapping.ecore2xml.Ecore2XMLPackage extend a common superclass
    2
    case Ecore2XMLPackage.XML_MAP__ID_ATTRIBUTE_NAME:
    3
    setParent((TreeNode)newValue);
    3
    setParent((TreeNode)newValue);
    3
    setIDAttributeName((String)newValue);
    Differences
    Expression1Expression2Difference
    setParentsetIDAttributeNameMETHOD_INVOCATION_NAME_MISMATCH
    org.eclipse.emf.edit.tree.TreeNodejava.lang.StringVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression setParent((TreeNode)newValue) is a void method call, and thus it cannot be parameterized
    Expression setIDAttributeName((String)newValue) is a void method call, and thus it cannot be parameterized
    Type org.eclipse.emf.edit.tree.TreeNode of variable (TreeNode)newValue does not match with type java.lang.String of variable (String)newValue
    • Make classes org.eclipse.emf.edit.tree.TreeNode and java.lang.String extend a common superclass
    3
    setIDAttributeName((String)newValue);
    4
    return;
    4
    return;
                                                                                                                                          
    6
    ((EStructuralFeature.Setting)getEcoreToXMLInfo()).set(newValue);
    5
    case TreePackage.TREE_NODE__CHILDREN:
    5
    case TreePackage.TREE_NODE__CHILDREN:
    8
    case Ecore2XMLPackage.XML_MAP__NO_NAMESPACE_PACKAGE:
    Differences
    Expression1Expression2Difference
    org.eclipse.emf.edit.tree.TreePackageorg.eclipse.emf.mapping.ecore2xml.Ecore2XMLPackageVARIABLE_TYPE_MISMATCH
    TREE_NODE__CHILDRENXML_MAP__NO_NAMESPACE_PACKAGEVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.edit.tree.TreePackage of variable TreePackage does not match with type org.eclipse.emf.mapping.ecore2xml.Ecore2XMLPackage of variable Ecore2XMLPackage
    • Make classes org.eclipse.emf.edit.tree.TreePackage and org.eclipse.emf.mapping.ecore2xml.Ecore2XMLPackage extend a common superclass
    8
    case Ecore2XMLPackage.XML_MAP__NO_NAMESPACE_PACKAGE:
    6
    getChildren().clear();
    6
    getChildren().clear();
    9
    setNoNamespacePackage((EPackage)newValue);
    Differences
    Expression1Expression2Difference
    clearsetNoNamespacePackageMETHOD_INVOCATION_NAME_MISMATCH
    getChildren().clear()setNoNamespacePackage((EPackage)newValue)ARGUMENT_NUMBER_MISMATCH
    getChildren()MISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression getChildren().clear() is a void method call, and thus it cannot be parameterized
    Expression setNoNamespacePackage((EPackage)newValue) 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 setNoNamespacePackage((EPackage)newValue) is a void method call, and thus it cannot be parameterized
    9
    setNoNamespacePackage((EPackage)newValue);
    7
    getChildren().addAll((Collection<?extendsTreeNode>)newValue);
                                                                                                                                        
    8
    return;
    10
    return;
    9
    case TreePackage.TREE_NODE__DATA:
    9
    case TreePackage.TREE_NODE__DATA:
    5
    case Ecore2XMLPackage.XML_MAP__ECORE_TO_XML_INFO:
    Differences
    Expression1Expression2Difference
    org.eclipse.emf.edit.tree.TreePackageorg.eclipse.emf.mapping.ecore2xml.Ecore2XMLPackageVARIABLE_TYPE_MISMATCH
    TREE_NODE__DATAXML_MAP__ECORE_TO_XML_INFOVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.edit.tree.TreePackage of variable TreePackage does not match with type org.eclipse.emf.mapping.ecore2xml.Ecore2XMLPackage of variable Ecore2XMLPackage
    • Make classes org.eclipse.emf.edit.tree.TreePackage and org.eclipse.emf.mapping.ecore2xml.Ecore2XMLPackage extend a common superclass
    5
    case Ecore2XMLPackage.XML_MAP__ECORE_TO_XML_INFO:
    10
    setData((EObject)newValue);
                                                                  
    11
    return;
    7
    return;
    12
    super.eSet(featureID, newValue);
    11
    super.eSet(featureID, newValue);
    Precondition Violations (10)
    Row Violation
    1Type org.eclipse.emf.edit.tree.TreePackage of variable TreePackage does not match with type org.eclipse.emf.mapping.ecore2xml.Ecore2XMLPackage of variable Ecore2XMLPackage
    2Expression setParent((TreeNode)newValue) is a void method call, and thus it cannot be parameterized
    3Expression setIDAttributeName((String)newValue) is a void method call, and thus it cannot be parameterized
    4Type org.eclipse.emf.edit.tree.TreeNode of variable (TreeNode)newValue does not match with type java.lang.String of variable (String)newValue
    5Type org.eclipse.emf.edit.tree.TreePackage of variable TreePackage does not match with type org.eclipse.emf.mapping.ecore2xml.Ecore2XMLPackage of variable Ecore2XMLPackage
    6Expression getChildren().clear() is a void method call, and thus it cannot be parameterized
    7Expression setNoNamespacePackage((EPackage)newValue) is a void method call, and thus it cannot be parameterized
    8Expression getChildren().clear() is a void method call, and thus it cannot be parameterized
    9Expression setNoNamespacePackage((EPackage)newValue) is a void method call, and thus it cannot be parameterized
    10Type org.eclipse.emf.edit.tree.TreePackage of variable TreePackage does not match with type org.eclipse.emf.mapping.ecore2xml.Ecore2XMLPackage of variable Ecore2XMLPackage