170-2-5

switch (featureID) { case Ecore2XMLPackage.XML_INFO__NAME: setName(NAME_EDEFAULT); return; case Ecore2XMLPackage.XML_INFO__TARGET_NAMESPACE: setTargetNamespace(TARGET_NAMESPACE_EDEFAULT); return; case Ecore2XMLPackage.XML_INFO__XML_REPRESENTATION: setXMLRepresentation(XML_REPRESENTATION_EDEFAULT); 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/XMLInfoImpl.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_INFO__NAME:↵

3

          case ↵

4

            setName(NAME_EDEFAULT↵

4

    TreePackage.TREE_NODE__PARENT:↵

5

    );↵

5

            setParent((TreeNode)null);↵

6

            return;↵

6

            return;↵

7

          case Ecore2XMLPackage.XML_INFO__TARGET_NAMESPACE:↵

7

          case TreePackage.TREE_NODE__CHILDREN:↵

8

            setTargetNamespace(TARGET_NAMESPACE_EDEFAULT);↵

8

            getChildren().clear();↵

9

            return;↵

9

            return;↵

10

          case Ecore2XMLPackage.XML_INFO__XML_REPRESENTATION:↵

10

          case ↵

11

            setXMLRepresentation(XML_REPRESENTATION_EDEFAULT↵

11

    TreePackage.TREE_NODE__DATA:↵

12

    );↵

12

            setData((EObject)null);↵

13

            return;↵

13

            return;↵

14

        }↵

14

        }↵

15

        super.eUnset(featureID);

15

        super.eUnset(featureID);

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 | 57

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 9
   Number of unmapped statements in the first code fragment | 2
   Number of unmapped statements in the second code fragment | 2
   Time elapsed for statement mapping (ms) | 2.4
   Clone type | Type 2

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

   1

       switch (featureID)

   1

       switch (featureID)

   2

       case Ecore2XMLPackage.XML_INFO__NAME:

   2 | case Ecore2XMLPackage.XML_INFO__NAME:
   5 | case TreePackage.TREE_NODE__CHILDREN:

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.eclipse.emf.mapping.ecore2xml.Ecore2XMLPackage | org.eclipse.emf.edit.tree.TreePackage | VARIABLE_TYPE_MISMATCH
   XML_INFO__NAME | TREE_NODE__CHILDREN | VARIABLE_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

       setName(NAME_EDEFAULT);

   3 | setName(NAME_EDEFAULT);
   6 | getChildren().clear();

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   setName | clear | METHOD_INVOCATION_NAME_MISMATCH
   setName(NAME_EDEFAULT) | getChildren().clear() | ARGUMENT_NUMBER_MISMATCH
   | getChildren() | MISSING_METHOD_INVOCATION_EXPRESSION

   Preondition Violations
   Expression setName(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 setName(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_INFO__TARGET_NAMESPACE:

   5 | case Ecore2XMLPackage.XML_INFO__TARGET_NAMESPACE:
   2 | case TreePackage.TREE_NODE__PARENT:

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.eclipse.emf.mapping.ecore2xml.Ecore2XMLPackage | org.eclipse.emf.edit.tree.TreePackage | VARIABLE_TYPE_MISMATCH
   XML_INFO__TARGET_NAMESPACE | TREE_NODE__PARENT | VARIABLE_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:

   3

       setParent((TreeNode)null);

   6

       setTargetNamespace(TARGET_NAMESPACE_EDEFAULT);

   7

       return;

   4

       return;

   8

       case Ecore2XMLPackage.XML_INFO__XML_REPRESENTATION:

   8 | case Ecore2XMLPackage.XML_INFO__XML_REPRESENTATION:
   8 | case TreePackage.TREE_NODE__DATA:

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.eclipse.emf.mapping.ecore2xml.Ecore2XMLPackage | org.eclipse.emf.edit.tree.TreePackage | VARIABLE_TYPE_MISMATCH
   XML_INFO__XML_REPRESENTATION | TREE_NODE__DATA | VARIABLE_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

       setData((EObject)null);

   9

       setXMLRepresentation(XML_REPRESENTATION_EDEFAULT);

   10

       return;

   10

       return;

   11

       super.eUnset(featureID);

   11

       super.eUnset(featureID);

   Precondition Violations (7)
   Row | Violation
   --- | ---
   1 | Type org.eclipse.emf.mapping.ecore2xml.Ecore2XMLPackage of variable Ecore2XMLPackage does not match with type org.eclipse.emf.edit.tree.TreePackage of variable TreePackage
   2 | Expression setName(NAME_EDEFAULT) is a void method call, and thus it cannot be parameterized
   3 | Expression getChildren().clear() is a void method call, and thus it cannot be parameterized
   4 | Expression setName(NAME_EDEFAULT) is a void method call, and thus it cannot be parameterized
   5 | Expression getChildren().clear() is a void method call, and thus it cannot be parameterized
   6 | Type org.eclipse.emf.mapping.ecore2xml.Ecore2XMLPackage of variable Ecore2XMLPackage does not match with type org.eclipse.emf.edit.tree.TreePackage of variable TreePackage
   7 | Type org.eclipse.emf.mapping.ecore2xml.Ecore2XMLPackage of variable Ecore2XMLPackage does not match with type org.eclipse.emf.edit.tree.TreePackage of variable TreePackage