10588-7-9

case XMLTypePackage.DATE_TIME: return validateDateTime((XMLGregorianCalendar)value, diagnostics, context); case XMLTypePackage.DECIMAL: return validateDecimal((BigDecimal)value, diagnostics, context); case XMLTypePackage.DOUBLE: return validateDouble(((Double)value).doubleValue(), diagnostics, context); case XMLTypePackage.DOUBLE_OBJECT: return validateDoubleObject((Double)value, diagnostics, context); case XMLTypePackage.DURATION:
case EcorePackage.ERESOURCE: return validateEResource((Resource)value, diagnostics, context); case EcorePackage.ERESOURCE_SET: return validateEResourceSet((ResourceSet)value, diagnostics, context); case EcorePackage.ESHORT: return validateEShort(((Short)value).shortValue(), diagnostics, context); case EcorePackage.ESHORT_OBJECT: return validateEShortObject((Short)value, diagnostics, context); case EcorePackage.ESTRING:

Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xml/type/util/XMLTypeValidator.java |  | File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/EcoreValidator.java
Method name: `boolean validate(int, Object, DiagnosticChain, Map)` |  | Method name: `boolean validate(int, Object, DiagnosticChain, Map)`
Number of AST nodes: 9 |  | Number of AST nodes: 9

1

    case XMLTypePackage.DATE_TIME:↵

1

    case EcorePackage.ERESOURCE:↵

2

            return validateDateTime((XMLGregorianCalendar)value, diagnostics, context);↵

2

            return validateEResource((Resource)value, diagnostics, context);↵

3

          case XMLTypePackage.DECIMAL:↵

3

          case EcorePackage.ERESOURCE_SET:↵

4

            return validateDecimal((BigDecimal)value, diagnostics, context);↵

4

            return validateEResourceSet((ResourceSet)value, diagnostics, context);↵

5

          case XMLTypePackage.DOUBLE:↵

5

          case EcorePackage.ESHORT:↵

6

            return validateDouble(((Double)value).doubleValue(), diagnostics, context);↵

6

            return validateEShort(((Short)value).shortValue(), diagnostics, context);↵

7

          case XMLTypePackage.DOUBLE_OBJECT:↵

7

          case EcorePackage.ESHORT_OBJECT:↵

8

            return validateDoubleObject((Double)value, diagnostics, context);↵

8

            return validateEShortObject((Short)value, diagnostics, context);↵

9

          case XMLTypePackage.DURATION:

9

          case EcorePackage.ESTRING:

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

1. {Non-refactorable}

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

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

   26

       case XMLTypePackage.DATE_TIME:

   26 | case XMLTypePackage.DATE_TIME:
   94 | case EcorePackage.ERESOURCE:

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.eclipse.emf.ecore.xml.type.XMLTypePackage | org.eclipse.emf.ecore.EcorePackage | VARIABLE_TYPE_MISMATCH
   DATE_TIME | ERESOURCE | VARIABLE_NAME_MISMATCH

   Preondition Violations

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

   94

       case EcorePackage.ERESOURCE:

   27

       return validateDateTime((XMLGregorianCalendar)value, diagnostics, context);

   27 | return validateDateTime((XMLGregorianCalendar)value, diagnostics, context);
   95 | return validateEResource((Resource)value, diagnostics, context);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   validateDateTime | validateEResource | METHOD_INVOCATION_NAME_MISMATCH
   javax.xml.datatype.XMLGregorianCalendar | org.eclipse.emf.ecore.resource.Resource | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type javax.xml.datatype.XMLGregorianCalendar of variable (XMLGregorianCalendar)value does not match with type org.eclipse.emf.ecore.resource.Resource of variable (Resource)value
   - Make classes javax.xml.datatype.XMLGregorianCalendar and org.eclipse.emf.ecore.resource.Resource extend a common superclass

   95

       return validateEResource((Resource)value, diagnostics, context);

   28

       case XMLTypePackage.DECIMAL:

   28 | case XMLTypePackage.DECIMAL:
   96 | case EcorePackage.ERESOURCE_SET:

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.eclipse.emf.ecore.xml.type.XMLTypePackage | org.eclipse.emf.ecore.EcorePackage | VARIABLE_TYPE_MISMATCH
   DECIMAL | ERESOURCE_SET | VARIABLE_NAME_MISMATCH

   Preondition Violations

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

   96

       case EcorePackage.ERESOURCE_SET:

   29

       return validateDecimal((BigDecimal)value, diagnostics, context);

   29 | return validateDecimal((BigDecimal)value, diagnostics, context);
   97 | return validateEResourceSet((ResourceSet)value, diagnostics, context);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   validateDecimal | validateEResourceSet | METHOD_INVOCATION_NAME_MISMATCH
   java.math.BigDecimal | org.eclipse.emf.ecore.resource.ResourceSet | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type java.math.BigDecimal of variable (BigDecimal)value does not match with type org.eclipse.emf.ecore.resource.ResourceSet of variable (ResourceSet)value
   - Make classes java.math.BigDecimal and org.eclipse.emf.ecore.resource.ResourceSet extend a common superclass

   97

       return validateEResourceSet((ResourceSet)value, diagnostics, context);

   30

       case XMLTypePackage.DOUBLE:

   30 | case XMLTypePackage.DOUBLE:
   98 | case EcorePackage.ESHORT:

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.eclipse.emf.ecore.xml.type.XMLTypePackage | org.eclipse.emf.ecore.EcorePackage | VARIABLE_TYPE_MISMATCH
   DOUBLE | ESHORT | VARIABLE_NAME_MISMATCH

   Preondition Violations

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

   98

       case EcorePackage.ESHORT:

   31

       return validateDouble(((Double)value).doubleValue(), diagnostics, context);

   31 | return validateDouble(((Double)value).doubleValue(), diagnostics, context);

   Preondition Violations
   Unmatched return validateDouble(((Double)value).doubleValue(),diagnostics,context);

   99 | return validateEShort(((Short)value).shortValue(), diagnostics, context);

   Preondition Violations
   Unmatched return validateEShort(((Short)value).shortValue(),diagnostics,context);

   99

       return validateEShort(((Short)value).shortValue(), diagnostics, context);

   32

       case XMLTypePackage.DOUBLE_OBJECT:

   32 | case XMLTypePackage.DOUBLE_OBJECT:
   100 | case EcorePackage.ESHORT_OBJECT:

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.eclipse.emf.ecore.xml.type.XMLTypePackage | org.eclipse.emf.ecore.EcorePackage | VARIABLE_TYPE_MISMATCH
   DOUBLE_OBJECT | ESHORT_OBJECT | VARIABLE_NAME_MISMATCH

   Preondition Violations

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

   100

       case EcorePackage.ESHORT_OBJECT:

   33

       return validateDoubleObject((Double)value, diagnostics, context);

   33 | return validateDoubleObject((Double)value, diagnostics, context);
   101 | return validateEShortObject((Short)value, diagnostics, context);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   validateDoubleObject | validateEShortObject | METHOD_INVOCATION_NAME_MISMATCH
   java.lang.Double | java.lang.Short | SUBCLASS_TYPE_MISMATCH

   101

       return validateEShortObject((Short)value, diagnostics, context);

   34

       case XMLTypePackage.DURATION:

   34 | case XMLTypePackage.DURATION:
   102 | case EcorePackage.ESTRING:

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.eclipse.emf.ecore.xml.type.XMLTypePackage | org.eclipse.emf.ecore.EcorePackage | VARIABLE_TYPE_MISMATCH
   DURATION | ESTRING | VARIABLE_NAME_MISMATCH

   Preondition Violations

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

   102

       case EcorePackage.ESTRING:

   Precondition Violations (9)
   Row | Violation
   --- | ---
   1 | Type org.eclipse.emf.ecore.xml.type.XMLTypePackage of variable XMLTypePackage does not match with type org.eclipse.emf.ecore.EcorePackage of variable EcorePackage
   2 | Type javax.xml.datatype.XMLGregorianCalendar of variable (XMLGregorianCalendar)value does not match with type org.eclipse.emf.ecore.resource.Resource of variable (Resource)value
   3 | Type org.eclipse.emf.ecore.xml.type.XMLTypePackage of variable XMLTypePackage does not match with type org.eclipse.emf.ecore.EcorePackage of variable EcorePackage
   4 | Type java.math.BigDecimal of variable (BigDecimal)value does not match with type org.eclipse.emf.ecore.resource.ResourceSet of variable (ResourceSet)value
   5 | Type org.eclipse.emf.ecore.xml.type.XMLTypePackage of variable XMLTypePackage does not match with type org.eclipse.emf.ecore.EcorePackage of variable EcorePackage
   6 | Unmatched return validateDouble(((Double)value).doubleValue(),diagnostics,context);
   7 | Unmatched return validateEShort(((Short)value).shortValue(),diagnostics,context);
   8 | Type org.eclipse.emf.ecore.xml.type.XMLTypePackage of variable XMLTypePackage does not match with type org.eclipse.emf.ecore.EcorePackage of variable EcorePackage
   9 | Type org.eclipse.emf.ecore.xml.type.XMLTypePackage of variable XMLTypePackage does not match with type org.eclipse.emf.ecore.EcorePackage of variable EcorePackage