10588-1-7

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:
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.ENTITIES_BASE:↵

1

    case XMLTypePackage.DATE_TIME:↵

2

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

2

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

3

          case XMLTypePackage.ENTITY:↵

3

          case XMLTypePackage.DECIMAL:↵

4

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

4

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

5

          case XMLTypePackage.FLOAT:↵

5

          case XMLTypePackage.DOUBLE:↵

6

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

6

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

7

          case XMLTypePackage.FLOAT_OBJECT:↵

7

          case XMLTypePackage.DOUBLE_OBJECT:↵

8

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

8

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

9

          case XMLTypePackage.GDAY:

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

   38

       case XMLTypePackage.ENTITIES_BASE:

   38 | case XMLTypePackage.ENTITIES_BASE:
   32 | case XMLTypePackage.DOUBLE_OBJECT:

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

   32

       case XMLTypePackage.DOUBLE_OBJECT:

   39

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

   39 | return validateENTITIESBase((List<?>)value, diagnostics, context);
   33 | return validateDoubleObject((Double)value, diagnostics, context);

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

   33

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

   40

       case XMLTypePackage.ENTITY:

   40 | case XMLTypePackage.ENTITY:
   28 | case XMLTypePackage.DECIMAL:

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

   28

       case XMLTypePackage.DECIMAL:

   41

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

   41 | return validateENTITY((String)value, diagnostics, context);
   29 | return validateDecimal((BigDecimal)value, diagnostics, context);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   validateENTITY | validateDecimal | METHOD_INVOCATION_NAME_MISMATCH
   java.lang.String | java.math.BigDecimal | VARIABLE_TYPE_MISMATCH

   Preondition Violations

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

   29

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

   42

       case XMLTypePackage.FLOAT:

   42 | case XMLTypePackage.FLOAT:
   34 | case XMLTypePackage.DURATION:

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

   34

       case XMLTypePackage.DURATION:

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

   44

       case XMLTypePackage.FLOAT_OBJECT:

   44 | case XMLTypePackage.FLOAT_OBJECT:
   26 | case XMLTypePackage.DATE_TIME:

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

   26

       case XMLTypePackage.DATE_TIME:

   45

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

   45 | return validateFloatObject((Float)value, diagnostics, context);
   27 | return validateDateTime((XMLGregorianCalendar)value, diagnostics, context);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   validateFloatObject | validateDateTime | METHOD_INVOCATION_NAME_MISMATCH
   java.lang.Float | javax.xml.datatype.XMLGregorianCalendar | VARIABLE_TYPE_MISMATCH

   Preondition Violations

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

   27

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

   46

       case XMLTypePackage.GDAY:

   46 | case XMLTypePackage.GDAY:
   30 | case XMLTypePackage.DOUBLE:

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

   30

       case XMLTypePackage.DOUBLE:

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

   Precondition Violations (4)
   Row | Violation
   --- | ---
   1 | Type java.lang.String of variable (String)value does not match with type java.math.BigDecimal of variable (BigDecimal)value
   2 | Unmatched return validateFloat(((Float)value).floatValue(),diagnostics,context);
   3 | Type java.lang.Float of variable (Float)value does not match with type javax.xml.datatype.XMLGregorianCalendar of variable (XMLGregorianCalendar)value
   4 | Unmatched return validateDouble(((Double)value).doubleValue(),diagnostics,context);