10588-4-7

case EcorePackage.EBIG_DECIMAL: return validateEBigDecimal((BigDecimal)value, diagnostics, context); case EcorePackage.EBIG_INTEGER: return validateEBigInteger((BigInteger)value, diagnostics, context); case EcorePackage.EBOOLEAN: return validateEBoolean(((Boolean)value).booleanValue(), diagnostics, context); case EcorePackage.EBOOLEAN_OBJECT: return validateEBooleanObject((Boolean)value, diagnostics, context); case EcorePackage.EBYTE:
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:

Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/EcoreValidator.java |  | File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xml/type/util/XMLTypeValidator.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 EcorePackage.EBIG_DECIMAL:↵

1

    case XMLTypePackage.DATE_TIME:↵

2

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

2

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

3

          case EcorePackage.EBIG_INTEGER:↵

3

          case XMLTypePackage.DECIMAL:↵

4

            return validateEBigInteger((BigInteger)value, diagnostics, context);↵

4

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

5

          case EcorePackage.EBOOLEAN:↵

5

          case XMLTypePackage.DOUBLE:↵

6

            return validateEBoolean(((Boolean)value).booleanValue(), diagnostics, context);↵

6

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

7

          case EcorePackage.EBOOLEAN_OBJECT:↵

7

          case XMLTypePackage.DOUBLE_OBJECT:↵

8

            return validateEBooleanObject((Boolean)value, diagnostics, context);↵

8

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

9

          case EcorePackage.EBYTE:

9

          case XMLTypePackage.DURATION:

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 | 9
   Number of unmapped statements in the first code fragment | 0
   Number of unmapped statements in the second code fragment | 0
   Time elapsed for statement mapping (ms) | 0.0
   Clone type | Type 2

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

   42

       case EcorePackage.EBIG_DECIMAL:

   42 | case EcorePackage.EBIG_DECIMAL:
   28 | case XMLTypePackage.DECIMAL:

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

   Preondition Violations

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

   28

       case XMLTypePackage.DECIMAL:

   43

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

   43 | return validateEBigDecimal((BigDecimal)value, diagnostics, context);
   29 | return validateDecimal((BigDecimal)value, diagnostics, context);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   validateEBigDecimal | validateDecimal | METHOD_INVOCATION_NAME_MISMATCH

   29

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

   44

       case EcorePackage.EBIG_INTEGER:

   44 | case EcorePackage.EBIG_INTEGER:
   26 | case XMLTypePackage.DATE_TIME:

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

   Preondition Violations

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

   26

       case XMLTypePackage.DATE_TIME:

   45

       return validateEBigInteger((BigInteger)value, diagnostics, context);

   45 | return validateEBigInteger((BigInteger)value, diagnostics, context);
   27 | return validateDateTime((XMLGregorianCalendar)value, diagnostics, context);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   validateEBigInteger | validateDateTime | METHOD_INVOCATION_NAME_MISMATCH
   java.math.BigInteger | javax.xml.datatype.XMLGregorianCalendar | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type java.math.BigInteger of variable (BigInteger)value does not match with type javax.xml.datatype.XMLGregorianCalendar of variable (XMLGregorianCalendar)value
   - Make classes java.math.BigInteger and javax.xml.datatype.XMLGregorianCalendar extend a common superclass

   27

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

   46

       case EcorePackage.EBOOLEAN:

   46 | case EcorePackage.EBOOLEAN:
   30 | case XMLTypePackage.DOUBLE:

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

   Preondition Violations

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

   30

       case XMLTypePackage.DOUBLE:

   47

       return validateEBoolean(((Boolean)value).booleanValue(), diagnostics, context);

   47 | return validateEBoolean(((Boolean)value).booleanValue(), diagnostics, context);
   31 | return validateDouble(((Double)value).doubleValue(), diagnostics, context);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   validateEBoolean | validateDouble | METHOD_INVOCATION_NAME_MISMATCH
   booleanValue | doubleValue | METHOD_INVOCATION_NAME_MISMATCH
   boolean | double | VARIABLE_TYPE_MISMATCH
   java.lang.Boolean | java.lang.Double | VARIABLE_TYPE_MISMATCH

   Preondition Violations
   Type boolean of variable ((Boolean)value).booleanValue() does not match with type double of variable ((Double)value).doubleValue()

   Type java.lang.Boolean of variable (Boolean)value does not match with type java.lang.Double of variable (Double)value
   - Make classes java.lang.Boolean and java.lang.Double extend a common superclass

   31

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

   48

       case EcorePackage.EBOOLEAN_OBJECT:

   48 | case EcorePackage.EBOOLEAN_OBJECT:
   32 | case XMLTypePackage.DOUBLE_OBJECT:

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

   Preondition Violations

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

   32

       case XMLTypePackage.DOUBLE_OBJECT:

   49

       return validateEBooleanObject((Boolean)value, diagnostics, context);

   49 | return validateEBooleanObject((Boolean)value, diagnostics, context);
   33 | return validateDoubleObject((Double)value, diagnostics, context);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   validateEBooleanObject | validateDoubleObject | METHOD_INVOCATION_NAME_MISMATCH
   java.lang.Boolean | java.lang.Double | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type java.lang.Boolean of variable (Boolean)value does not match with type java.lang.Double of variable (Double)value
   - Make classes java.lang.Boolean and java.lang.Double extend a common superclass

   33

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

   50

       case EcorePackage.EBYTE:

   50 | case EcorePackage.EBYTE:
   34 | case XMLTypePackage.DURATION:

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

   Preondition Violations

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

   34

       case XMLTypePackage.DURATION:

   Precondition Violations (9)
   Row | Violation
   --- | ---
   1 | Type org.eclipse.emf.ecore.EcorePackage of variable EcorePackage does not match with type org.eclipse.emf.ecore.xml.type.XMLTypePackage of variable XMLTypePackage
   2 | Type org.eclipse.emf.ecore.EcorePackage of variable EcorePackage does not match with type org.eclipse.emf.ecore.xml.type.XMLTypePackage of variable XMLTypePackage
   3 | Type java.math.BigInteger of variable (BigInteger)value does not match with type javax.xml.datatype.XMLGregorianCalendar of variable (XMLGregorianCalendar)value
   4 | Type org.eclipse.emf.ecore.EcorePackage of variable EcorePackage does not match with type org.eclipse.emf.ecore.xml.type.XMLTypePackage of variable XMLTypePackage
   5 | Type boolean of variable ((Boolean)value).booleanValue() does not match with type double of variable ((Double)value).doubleValue()
   6 | Type java.lang.Boolean of variable (Boolean)value does not match with type java.lang.Double of variable (Double)value
   7 | Type org.eclipse.emf.ecore.EcorePackage of variable EcorePackage does not match with type org.eclipse.emf.ecore.xml.type.XMLTypePackage of variable XMLTypePackage
   8 | Type java.lang.Boolean of variable (Boolean)value does not match with type java.lang.Double of variable (Double)value
   9 | Type org.eclipse.emf.ecore.EcorePackage of variable EcorePackage does not match with type org.eclipse.emf.ecore.xml.type.XMLTypePackage of variable XMLTypePackage