170-2-4

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 MappingPackage.MAPPING_ROOT__OUTPUT_READ_ONLY: setOutputReadOnly(OUTPUT_READ_ONLY_EDEFAULT); return; case MappingPackage.MAPPING_ROOT__TOP_TO_BOTTOM: setTopToBottom(TOP_TO_BOTTOM_EDEFAULT); return; case MappingPackage.MAPPING_ROOT__COMMAND_STACK: setCommandStack(COMMAND_STACK_EDEFAULT); 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/mapping/impl/MappingRootImpl.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↵

4

    MappingPackage.MAPPING_ROOT__OUTPUT_READ_ONLY:↵

5

    _EDEFAULT);↵

5

            setOutputReadOnly(OUTPUT_READ_ONLY_EDEFAULT);↵

6

            return;↵

6

            return;↵

7

          case Ecore2XMLPackage.XML_INFO__TARGET_NAMESPACE:↵

7

          case ↵

8

            setTargetNamespace(TARGET_NAMESPACE↵

8

    MappingPackage.MAPPING_ROOT__TOP_TO_BOTTOM:↵

9

    _EDEFAULT);↵

9

            setTopToBottom(TOP_TO_BOTTOM_EDEFAULT);↵

10

            return;↵

10

            return;↵

11

          case Ecore2XMLPackage.XML_INFO__XML_REPRESENTATION:↵

11

          case ↵

12

            setXMLRepresentation(XML_REPRESENTATION↵

12

    MappingPackage.MAPPING_ROOT__COMMAND_STACK:↵

13

    _EDEFAULT);↵

13

            setCommandStack(COMMAND_STACK_EDEFAULT);↵

14

            return;↵

14

            return;↵

15

        }↵

15

        }↵

16

        super.eUnset(featureID);

16

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

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

   1

       switch (featureID)

   1

       switch (featureID)

   3

       setOutputReadOnly(OUTPUT_READ_ONLY_EDEFAULT);

   2

       case Ecore2XMLPackage.XML_INFO__NAME:

   2 | case Ecore2XMLPackage.XML_INFO__NAME:
   8 | case MappingPackage.MAPPING_ROOT__COMMAND_STACK:

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.eclipse.emf.mapping.ecore2xml.Ecore2XMLPackage | org.eclipse.emf.mapping.MappingPackage | VARIABLE_TYPE_MISMATCH
   XML_INFO__NAME | MAPPING_ROOT__COMMAND_STACK | VARIABLE_NAME_MISMATCH

   Preondition Violations

   Type org.eclipse.emf.mapping.ecore2xml.Ecore2XMLPackage of variable Ecore2XMLPackage does not match with type org.eclipse.emf.mapping.MappingPackage of variable MappingPackage
   - Make classes org.eclipse.emf.mapping.ecore2xml.Ecore2XMLPackage and org.eclipse.emf.mapping.MappingPackage extend a common superclass

   8

       case MappingPackage.MAPPING_ROOT__COMMAND_STACK:

   3

       setName(NAME_EDEFAULT);

   3 | setName(NAME_EDEFAULT);
   9 | setCommandStack(COMMAND_STACK_EDEFAULT);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   setName | setCommandStack | METHOD_INVOCATION_NAME_MISMATCH
   NAME_EDEFAULT | COMMAND_STACK_EDEFAULT | VARIABLE_NAME_MISMATCH

   Preondition Violations
   Expression setName(NAME_EDEFAULT) is a void method call, and thus it cannot be parameterized
   Expression setCommandStack(COMMAND_STACK_EDEFAULT) is a void method call, and thus it cannot be parameterized

   9

       setCommandStack(COMMAND_STACK_EDEFAULT);

   4

       return;

   10

       return;

   5

       case Ecore2XMLPackage.XML_INFO__TARGET_NAMESPACE:

   5 | case Ecore2XMLPackage.XML_INFO__TARGET_NAMESPACE:
   5 | case MappingPackage.MAPPING_ROOT__TOP_TO_BOTTOM:

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.eclipse.emf.mapping.ecore2xml.Ecore2XMLPackage | org.eclipse.emf.mapping.MappingPackage | VARIABLE_TYPE_MISMATCH
   XML_INFO__TARGET_NAMESPACE | MAPPING_ROOT__TOP_TO_BOTTOM | VARIABLE_NAME_MISMATCH

   Preondition Violations

   Type org.eclipse.emf.mapping.ecore2xml.Ecore2XMLPackage of variable Ecore2XMLPackage does not match with type org.eclipse.emf.mapping.MappingPackage of variable MappingPackage
   - Make classes org.eclipse.emf.mapping.ecore2xml.Ecore2XMLPackage and org.eclipse.emf.mapping.MappingPackage extend a common superclass

   5

       case MappingPackage.MAPPING_ROOT__TOP_TO_BOTTOM:

   6

       setTargetNamespace(TARGET_NAMESPACE_EDEFAULT);

   7

       return;

   7

       return;

   8

       case Ecore2XMLPackage.XML_INFO__XML_REPRESENTATION:

   8 | case Ecore2XMLPackage.XML_INFO__XML_REPRESENTATION:
   2 | case MappingPackage.MAPPING_ROOT__OUTPUT_READ_ONLY:

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.eclipse.emf.mapping.ecore2xml.Ecore2XMLPackage | org.eclipse.emf.mapping.MappingPackage | VARIABLE_TYPE_MISMATCH
   XML_INFO__XML_REPRESENTATION | MAPPING_ROOT__OUTPUT_READ_ONLY | VARIABLE_NAME_MISMATCH

   Preondition Violations

   Type org.eclipse.emf.mapping.ecore2xml.Ecore2XMLPackage of variable Ecore2XMLPackage does not match with type org.eclipse.emf.mapping.MappingPackage of variable MappingPackage
   - Make classes org.eclipse.emf.mapping.ecore2xml.Ecore2XMLPackage and org.eclipse.emf.mapping.MappingPackage extend a common superclass

   2

       case MappingPackage.MAPPING_ROOT__OUTPUT_READ_ONLY:

   9

       setXMLRepresentation(XML_REPRESENTATION_EDEFAULT);

   10

       return;

   4

       return;

   6

       setTopToBottom(TOP_TO_BOTTOM_EDEFAULT);

   11

       super.eUnset(featureID);

   11

       super.eUnset(featureID);

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