10588-4-9

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 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/util/EcoreValidator.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 EcorePackage.EBIG_DECIMAL:↵

1

    case EcorePackage.ERESOURCE:↵

2

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

2

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

3

          case EcorePackage.EBIG_INTEGER:↵

3

          case EcorePackage.ERESOURCE_SET:↵

4

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

4

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

5

          case EcorePackage.EBOOLEAN:↵

5

          case EcorePackage.ESHORT:↵

6

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

6

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

7

          case EcorePackage.EBOOLEAN_OBJECT:↵

7

          case EcorePackage.ESHORT_OBJECT:↵

8

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

8

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

9

          case EcorePackage.EBYTE:

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 the same method
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:
   94 | case EcorePackage.ERESOURCE:

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   EBIG_DECIMAL | ERESOURCE | VARIABLE_NAME_MISMATCH

   94

       case EcorePackage.ERESOURCE:

   43

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

   43 | return validateEBigDecimal((BigDecimal)value, diagnostics, context);
   95 | return validateEResource((Resource)value, diagnostics, context);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   validateEBigDecimal | validateEResource | METHOD_INVOCATION_NAME_MISMATCH
   java.math.BigDecimal | org.eclipse.emf.ecore.resource.Resource | VARIABLE_TYPE_MISMATCH

   Preondition Violations

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

   95

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

   44

       case EcorePackage.EBIG_INTEGER:

   44 | case EcorePackage.EBIG_INTEGER:
   96 | case EcorePackage.ERESOURCE_SET:

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   EBIG_INTEGER | ERESOURCE_SET | VARIABLE_NAME_MISMATCH

   96

       case EcorePackage.ERESOURCE_SET:

   45

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

   45 | return validateEBigInteger((BigInteger)value, diagnostics, context);
   97 | return validateEResourceSet((ResourceSet)value, diagnostics, context);

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

   Preondition Violations

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

   97

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

   46

       case EcorePackage.EBOOLEAN:

   46 | case EcorePackage.EBOOLEAN:
   98 | case EcorePackage.ESHORT:

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   EBOOLEAN | ESHORT | VARIABLE_NAME_MISMATCH

   98

       case EcorePackage.ESHORT:

   47

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

   47 | return validateEBoolean(((Boolean)value).booleanValue(), diagnostics, context);
   99 | return validateEShort(((Short)value).shortValue(), diagnostics, context);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   validateEBoolean | validateEShort | METHOD_INVOCATION_NAME_MISMATCH
   booleanValue | shortValue | METHOD_INVOCATION_NAME_MISMATCH
   boolean | short | VARIABLE_TYPE_MISMATCH
   java.lang.Boolean | java.lang.Short | VARIABLE_TYPE_MISMATCH

   Preondition Violations
   Type boolean of variable ((Boolean)value).booleanValue() does not match with type short of variable ((Short)value).shortValue()

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

   99

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

   48

       case EcorePackage.EBOOLEAN_OBJECT:

   48 | case EcorePackage.EBOOLEAN_OBJECT:
   100 | case EcorePackage.ESHORT_OBJECT:

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   EBOOLEAN_OBJECT | ESHORT_OBJECT | VARIABLE_NAME_MISMATCH

   100

       case EcorePackage.ESHORT_OBJECT:

   49

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

   49 | return validateEBooleanObject((Boolean)value, diagnostics, context);
   101 | return validateEShortObject((Short)value, diagnostics, context);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   validateEBooleanObject | validateEShortObject | METHOD_INVOCATION_NAME_MISMATCH
   java.lang.Boolean | java.lang.Short | VARIABLE_TYPE_MISMATCH

   Preondition Violations

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

   101

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

   50

       case EcorePackage.EBYTE:

   50 | case EcorePackage.EBYTE:
   102 | case EcorePackage.ESTRING:

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   EBYTE | ESTRING | VARIABLE_NAME_MISMATCH

   102

       case EcorePackage.ESTRING:

   Precondition Violations (5)
   Row | Violation
   --- | ---
   1 | Type java.math.BigDecimal of variable (BigDecimal)value does not match with type org.eclipse.emf.ecore.resource.Resource of variable (Resource)value
   2 | Type java.math.BigInteger of variable (BigInteger)value does not match with type org.eclipse.emf.ecore.resource.ResourceSet of variable (ResourceSet)value
   3 | Type boolean of variable ((Boolean)value).booleanValue() does not match with type short of variable ((Short)value).shortValue()
   4 | Type java.lang.Boolean of variable (Boolean)value does not match with type java.lang.Short of variable (Short)value
   5 | Type java.lang.Boolean of variable (Boolean)value does not match with type java.lang.Short of variable (Short)value