10881-4-5

return createLangTypeFromString(eDataType, initialValue); case XMLNamespacePackage.LANG_TYPE_NULL: return createLangTypeNullFromString(eDataType, initialValue); case XMLNamespacePackage.SPACE_TYPE_OBJECT: return createSpaceTypeObjectFromString(eDataType, initialValue); default: throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
return convertEShortToString(eDataType, instanceValue); case EcorePackage.ESHORT_OBJECT: return convertEShortObjectToString(eDataType, instanceValue); case EcorePackage.ESTRING: return convertEStringToString(eDataType, instanceValue); default: throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");

Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xml/namespace/impl/XMLNamespaceFactoryImpl.java |  | File path: /emf-2.4.1/src/org/eclipse/emf/ecore/impl/EcoreFactoryImpl.java
Method name: `Object createFromString(EDataType, String)` |  | Method name: `String convertToString(EDataType, Object)`
Number of AST nodes: 7 |  | Number of AST nodes: 7

1

    return createLangTypeFromString(eDataType, initialValue);↵

1

    return convertEShortToString(eDataType, instanceValue);↵

2

          case XMLNamespacePackage.LANG_TYPE_NULL:↵

2

          case ↵

3

            return createLangTypeNullFrom↵

3

    EcorePackage.ESHORT_OBJECT:↵

4

    String(eDataType, initialValue);↵

4

            return convertEShortObjectToString(eDataType, instanceValue);↵

5

          case XMLNamespacePackage.SPACE_TYPE_OBJECT:↵

5

          case ↵

6

            return createSpaceTypeObjectFrom↵

6

    EcorePackage.ESTRING:↵

7

    String(eDataType, initialValue);↵

7

            return convertEStringToString(eDataType, instanceValue);↵

8

          default:↵

8

          default:↵

9

            throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");

9

            throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");

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.0
Clones location | Clones are in different classes having the same super class
Number of node comparisons | 30

1. {Non-refactorable}

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

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

   5

       return createLangTypeFromString(eDataType, initialValue);

   5 | return createLangTypeFromString(eDataType, initialValue);

   Preondition Violations
   Unmatched return createLangTypeFromString(eDataType,initialValue);

   43 | return convertEShortToString(eDataType, instanceValue);

   Preondition Violations
   Unmatched return convertEShortToString(eDataType,instanceValue);

   43

       return convertEShortToString(eDataType, instanceValue);

   6

       case XMLNamespacePackage.LANG_TYPE_NULL:

   6 | case XMLNamespacePackage.LANG_TYPE_NULL:
   44 | case EcorePackage.ESHORT_OBJECT:

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.eclipse.emf.ecore.xml.namespace.XMLNamespacePackage | org.eclipse.emf.ecore.EcorePackage | VARIABLE_TYPE_MISMATCH
   LANG_TYPE_NULL | ESHORT_OBJECT | VARIABLE_NAME_MISMATCH

   Preondition Violations

   Type org.eclipse.emf.ecore.xml.namespace.XMLNamespacePackage of variable XMLNamespacePackage does not match with type org.eclipse.emf.ecore.EcorePackage of variable EcorePackage
   - Make classes org.eclipse.emf.ecore.xml.namespace.XMLNamespacePackage and org.eclipse.emf.ecore.EcorePackage extend a common superclass

   44

       case EcorePackage.ESHORT_OBJECT:

   7

       return createLangTypeNullFromString(eDataType, initialValue);

   7 | return createLangTypeNullFromString(eDataType, initialValue);

   Preondition Violations
   Unmatched return createLangTypeNullFromString(eDataType,initialValue);

   45 | return convertEShortObjectToString(eDataType, instanceValue);

   Preondition Violations
   Unmatched return convertEShortObjectToString(eDataType,instanceValue);

   45

       return convertEShortObjectToString(eDataType, instanceValue);

   8

       case XMLNamespacePackage.SPACE_TYPE_OBJECT:

   8 | case XMLNamespacePackage.SPACE_TYPE_OBJECT:
   46 | case EcorePackage.ESTRING:

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.eclipse.emf.ecore.xml.namespace.XMLNamespacePackage | org.eclipse.emf.ecore.EcorePackage | VARIABLE_TYPE_MISMATCH
   SPACE_TYPE_OBJECT | ESTRING | VARIABLE_NAME_MISMATCH

   Preondition Violations

   Type org.eclipse.emf.ecore.xml.namespace.XMLNamespacePackage of variable XMLNamespacePackage does not match with type org.eclipse.emf.ecore.EcorePackage of variable EcorePackage
   - Make classes org.eclipse.emf.ecore.xml.namespace.XMLNamespacePackage and org.eclipse.emf.ecore.EcorePackage extend a common superclass

   46

       case EcorePackage.ESTRING:

   9

       return createSpaceTypeObjectFromString(eDataType, initialValue);

   9 | return createSpaceTypeObjectFromString(eDataType, initialValue);

   Preondition Violations
   Unmatched return createSpaceTypeObjectFromString(eDataType,initialValue);

   47 | return convertEStringToString(eDataType, instanceValue);

   Preondition Violations
   Unmatched return convertEStringToString(eDataType,instanceValue);

   47

       return convertEStringToString(eDataType, instanceValue);

   10

       default:

   48

       default:

   11

       throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");

   49

       throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");

   Precondition Violations (8)
   Row | Violation
   --- | ---
   1 | Unmatched return createLangTypeFromString(eDataType,initialValue);
   2 | Unmatched return convertEShortToString(eDataType,instanceValue);
   3 | Type org.eclipse.emf.ecore.xml.namespace.XMLNamespacePackage of variable XMLNamespacePackage does not match with type org.eclipse.emf.ecore.EcorePackage of variable EcorePackage
   4 | Unmatched return createLangTypeNullFromString(eDataType,initialValue);
   5 | Unmatched return convertEShortObjectToString(eDataType,instanceValue);
   6 | Type org.eclipse.emf.ecore.xml.namespace.XMLNamespacePackage of variable XMLNamespacePackage does not match with type org.eclipse.emf.ecore.EcorePackage of variable EcorePackage
   7 | Unmatched return createSpaceTypeObjectFromString(eDataType,initialValue);
   8 | Unmatched return convertEStringToString(eDataType,instanceValue);