10588-3-7

case XMLTypePackage.POSITIVE_INTEGER: return validatePositiveInteger((BigInteger)value, diagnostics, context); case XMLTypePackage.QNAME: return validateQName((QName)value, diagnostics, context); case XMLTypePackage.SHORT: return validateShort(((Short)value).shortValue(), diagnostics, context); case XMLTypePackage.SHORT_OBJECT: return validateShortObject((Short)value, diagnostics, context); case XMLTypePackage.STRING:
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/xml/type/util/XMLTypeValidator.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 XMLTypePackage.POSITIVE_INTEGER:↵

1

    case XMLTypePackage.DATE_TIME:↵

2

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

2

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

3

          case XMLTypePackage.QNAME:↵

3

          case XMLTypePackage.DECIMAL:↵

4

            return validateQName((QName)value, diagnostics, context);↵

4

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

5

          case XMLTypePackage.SHORT:↵

5

          case XMLTypePackage.DOUBLE:↵

6

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

6

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

7

          case XMLTypePackage.SHORT_OBJECT:↵

7

          case XMLTypePackage.DOUBLE_OBJECT:↵

8

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

8

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

9

          case XMLTypePackage.STRING:

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 the same method
Number of node comparisons | 52

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

   98

       case XMLTypePackage.POSITIVE_INTEGER:

   98 | case XMLTypePackage.POSITIVE_INTEGER:
   26 | case XMLTypePackage.DATE_TIME:

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   POSITIVE_INTEGER | DATE_TIME | VARIABLE_NAME_MISMATCH

   26

       case XMLTypePackage.DATE_TIME:

   99

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

   99 | return validatePositiveInteger((BigInteger)value, diagnostics, context);
   27 | return validateDateTime((XMLGregorianCalendar)value, diagnostics, context);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   validatePositiveInteger | 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);

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

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

   31

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

   100

       case XMLTypePackage.QNAME:

   100 | case XMLTypePackage.QNAME:
   32 | case XMLTypePackage.DOUBLE_OBJECT:

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   QNAME | DOUBLE_OBJECT | VARIABLE_NAME_MISMATCH

   32

       case XMLTypePackage.DOUBLE_OBJECT:

   101

       return validateQName((QName)value, diagnostics, context);

   101 | return validateQName((QName)value, diagnostics, context);
   33 | return validateDoubleObject((Double)value, diagnostics, context);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   validateQName | validateDoubleObject | METHOD_INVOCATION_NAME_MISMATCH
   javax.xml.namespace.QName | java.lang.Double | VARIABLE_TYPE_MISMATCH

   Preondition Violations

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

   33

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

   102

       case XMLTypePackage.SHORT:

   102 | case XMLTypePackage.SHORT:
   34 | case XMLTypePackage.DURATION:

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   SHORT | DURATION | VARIABLE_NAME_MISMATCH

   34

       case XMLTypePackage.DURATION:

   103

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

   103 | return validateShort(((Short)value).shortValue(), diagnostics, context);

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

   104

       case XMLTypePackage.SHORT_OBJECT:

   104 | case XMLTypePackage.SHORT_OBJECT:
   28 | case XMLTypePackage.DECIMAL:

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   SHORT_OBJECT | DECIMAL | VARIABLE_NAME_MISMATCH

   28

       case XMLTypePackage.DECIMAL:

   105

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

   105 | return validateShortObject((Short)value, diagnostics, context);
   29 | return validateDecimal((BigDecimal)value, diagnostics, context);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   validateShortObject | validateDecimal | METHOD_INVOCATION_NAME_MISMATCH
   java.lang.Short | java.math.BigDecimal | SUBCLASS_TYPE_MISMATCH

   29

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

   106

       case XMLTypePackage.STRING:

   106 | case XMLTypePackage.STRING:
   30 | case XMLTypePackage.DOUBLE:

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   STRING | DOUBLE | VARIABLE_NAME_MISMATCH

   30

       case XMLTypePackage.DOUBLE:

   Precondition Violations (4)
   Row | Violation
   --- | ---
   1 | Type java.math.BigInteger of variable (BigInteger)value does not match with type javax.xml.datatype.XMLGregorianCalendar of variable (XMLGregorianCalendar)value
   2 | Unmatched return validateDouble(((Double)value).doubleValue(),diagnostics,context);
   3 | Type javax.xml.namespace.QName of variable (QName)value does not match with type java.lang.Double of variable (Double)value
   4 | Unmatched return validateShort(((Short)value).shortValue(),diagnostics,context);