10589-2-3

case XMLTypePackage.ENTITIES_BASE: return validateENTITIESBase((List<?>)value, diagnostics, context); case XMLTypePackage.ENTITY: return validateENTITY((String)value, diagnostics, context); case XMLTypePackage.FLOAT: return validateFloat(((Float)value).floatValue(), diagnostics, context); case XMLTypePackage.FLOAT_OBJECT: return validateFloatObject((Float)value, diagnostics, context); case XMLTypePackage.GDAY: return validateGDay((XMLGregorianCalendar)value, diagnostics, context); case XMLTypePackage.GMONTH:
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: return validateString((String)value, diagnostics, context); case XMLTypePackage.TIME:

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: 11 |  | Number of AST nodes: 11

1

    case XMLTypePackage.ENTITIES_BASE:↵

1

    case XMLTypePackage.POSITIVE_INTEGER:↵

2

            return validateENTITIESBase((List<?>)value, diagnostics, context);↵

2

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

3

          case XMLTypePackage.ENTITY:↵

3

          case XMLTypePackage.QNAME:↵

4

            return validateENTITY((String)value, diagnostics, context);↵

4

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

5

          case XMLTypePackage.FLOAT:↵

5

          case XMLTypePackage.SHORT:↵

6

            return validateFloat(((Float)value).floatValue(), diagnostics, context);↵

6

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

7

          case XMLTypePackage.FLOAT_OBJECT:↵

7

          case XMLTypePackage.SHORT_OBJECT:↵

8

            return validateFloatObject((Float)value, diagnostics, context);↵

8

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

9

          case XMLTypePackage.GDAY:↵

9

          case XMLTypePackage.STRING:↵

10

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

10

            return validateString((String)value, diagnostics, context);↵

11

          case XMLTypePackage.GMONTH:

11

          case XMLTypePackage.TIME:

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

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 10
   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
   --- | --- | --- | --- | ---

   38

       case XMLTypePackage.ENTITIES_BASE:

   38 | case XMLTypePackage.ENTITIES_BASE:
   98 | case XMLTypePackage.POSITIVE_INTEGER:

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

   98

       case XMLTypePackage.POSITIVE_INTEGER:

   39

       return validateENTITIESBase((List<?>)value, diagnostics, context);

   39 | return validateENTITIESBase((List<?>)value, diagnostics, context);
   99 | return validatePositiveInteger((BigInteger)value, diagnostics, context);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   validateENTITIESBase | validatePositiveInteger | METHOD_INVOCATION_NAME_MISMATCH

   99

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

   40

       case XMLTypePackage.ENTITY:

   40 | case XMLTypePackage.ENTITY:
   100 | case XMLTypePackage.QNAME:

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

   100

       case XMLTypePackage.QNAME:

   41

       return validateENTITY((String)value, diagnostics, context);

   41 | return validateENTITY((String)value, diagnostics, context);
   101 | return validateQName((QName)value, diagnostics, context);

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

   Preondition Violations

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

   101

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

   42

       case XMLTypePackage.FLOAT:

   42 | case XMLTypePackage.FLOAT:
   102 | case XMLTypePackage.SHORT:

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

   102

       case XMLTypePackage.SHORT:

   43

       return validateFloat(((Float)value).floatValue(), diagnostics, context);

   43 | return validateFloat(((Float)value).floatValue(), diagnostics, context);

   Preondition Violations
   Unmatched return validateFloat(((Float)value).floatValue(),diagnostics,context);

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

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

   103

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

   44

       case XMLTypePackage.FLOAT_OBJECT:

   44 | case XMLTypePackage.FLOAT_OBJECT:
   106 | case XMLTypePackage.STRING:

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

   106

       case XMLTypePackage.STRING:

   45

       return validateFloatObject((Float)value, diagnostics, context);

   45 | return validateFloatObject((Float)value, diagnostics, context);
   107 | return validateString((String)value, diagnostics, context);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   validateFloatObject | validateString | METHOD_INVOCATION_NAME_MISMATCH
   java.lang.Float | java.lang.String | VARIABLE_TYPE_MISMATCH

   Preondition Violations

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

   107

       return validateString((String)value, diagnostics, context);

   46

       case XMLTypePackage.GDAY:

   46 | case XMLTypePackage.GDAY:
   104 | case XMLTypePackage.SHORT_OBJECT:

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

   104

       case XMLTypePackage.SHORT_OBJECT:

   47

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

   47 | return validateGDay((XMLGregorianCalendar)value, diagnostics, context);
   105 | return validateShortObject((Short)value, diagnostics, context);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   validateGDay | validateShortObject | METHOD_INVOCATION_NAME_MISMATCH
   javax.xml.datatype.XMLGregorianCalendar | java.lang.Short | VARIABLE_TYPE_MISMATCH

   Preondition Violations

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

   105

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

   48

       case XMLTypePackage.GMONTH:

   48 | case XMLTypePackage.GMONTH:
   108 | case XMLTypePackage.TIME:

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   GMONTH | TIME | VARIABLE_NAME_MISMATCH

   108

       case XMLTypePackage.TIME:

   Precondition Violations (5)
   Row | Violation
   --- | ---
   1 | Type java.lang.String of variable (String)value does not match with type javax.xml.namespace.QName of variable (QName)value
   2 | Unmatched return validateFloat(((Float)value).floatValue(),diagnostics,context);
   3 | Unmatched return validateShort(((Short)value).shortValue(),diagnostics,context);
   4 | Type java.lang.Float of variable (Float)value does not match with type java.lang.String of variable (String)value
   5 | Type javax.xml.datatype.XMLGregorianCalendar of variable (XMLGregorianCalendar)value does not match with type java.lang.Short of variable (Short)value