10588-6-9

case EcorePackage.EFEATURE_MAP: return validateEFeatureMap((FeatureMap)value, diagnostics, context); case EcorePackage.EFEATURE_MAP_ENTRY: return validateEFeatureMapEntry((FeatureMap.Entry)value, diagnostics, context); case EcorePackage.EFLOAT: return validateEFloat(((Float)value).floatValue(), diagnostics, context); case EcorePackage.EFLOAT_OBJECT: return validateEFloatObject((Float)value, diagnostics, context); case EcorePackage.EINT:
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.EFEATURE_MAP:↵

1

    case EcorePackage.ERESOURCE:↵

2

            return validateEFeatureMap((FeatureMap)value, diagnostics, context);↵

2

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

3

          case EcorePackage.EFEATURE_MAP_ENTRY:↵

3

          case EcorePackage.ERESOURCE_SET:↵

4

            return validateEFeatureMapEntry((FeatureMap.Entry)value, diagnostics, context);↵

4

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

5

          case EcorePackage.EFLOAT:↵

5

          case EcorePackage.ESHORT:↵

6

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

6

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

7

          case EcorePackage.EFLOAT_OBJECT:↵

7

          case EcorePackage.ESHORT_OBJECT:↵

8

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

8

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

9

          case EcorePackage.EINT:

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

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 7
   Number of unmapped statements in the first code fragment | 2
   Number of unmapped statements in the second code fragment | 2
   Time elapsed for statement mapping (ms) | 0.0
   Clone type | Type 2

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

   72

       case EcorePackage.EFEATURE_MAP:

   72 | case EcorePackage.EFEATURE_MAP:
   94 | case EcorePackage.ERESOURCE:

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

   94

       case EcorePackage.ERESOURCE:

   73

       return validateEFeatureMap((FeatureMap)value, diagnostics, context);

   73 | return validateEFeatureMap((FeatureMap)value, diagnostics, context);
   95 | return validateEResource((Resource)value, diagnostics, context);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   validateEFeatureMap | validateEResource | METHOD_INVOCATION_NAME_MISMATCH
   org.eclipse.emf.ecore.util.FeatureMap | org.eclipse.emf.ecore.resource.Resource | VARIABLE_TYPE_MISMATCH

   Preondition Violations

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

   95

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

   74

       case EcorePackage.EFEATURE_MAP_ENTRY:

   74 | case EcorePackage.EFEATURE_MAP_ENTRY:
   96 | case EcorePackage.ERESOURCE_SET:

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

   96

       case EcorePackage.ERESOURCE_SET:

   75

       return validateEFeatureMapEntry((FeatureMap.Entry)value, diagnostics, context);

   75 | return validateEFeatureMapEntry((FeatureMap.Entry)value, diagnostics, context);

   Preondition Violations
   Unmatched return validateEFeatureMapEntry((FeatureMap.Entry)value,diagnostics,context);

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

   Preondition Violations
   Unmatched return validateEResourceSet((ResourceSet)value,diagnostics,context);

   97

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

   76

       case EcorePackage.EFLOAT:

   76 | case EcorePackage.EFLOAT:
   98 | case EcorePackage.ESHORT:

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

   98

       case EcorePackage.ESHORT:

   77

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

   77 | return validateEFloat(((Float)value).floatValue(), diagnostics, context);

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

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

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

   99

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

   78

       case EcorePackage.EFLOAT_OBJECT:

   78 | case EcorePackage.EFLOAT_OBJECT:
   100 | case EcorePackage.ESHORT_OBJECT:

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

   100

       case EcorePackage.ESHORT_OBJECT:

   79

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

   79 | return validateEFloatObject((Float)value, diagnostics, context);
   101 | return validateEShortObject((Short)value, diagnostics, context);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   validateEFloatObject | validateEShortObject | METHOD_INVOCATION_NAME_MISMATCH
   java.lang.Float | java.lang.Short | SUBCLASS_TYPE_MISMATCH

   101

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

   80

       case EcorePackage.EINT:

   80 | case EcorePackage.EINT:
   102 | case EcorePackage.ESTRING:

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

   102

       case EcorePackage.ESTRING:

   Precondition Violations (5)
   Row | Violation
   --- | ---
   1 | Type org.eclipse.emf.ecore.util.FeatureMap of variable (FeatureMap)value does not match with type org.eclipse.emf.ecore.resource.Resource of variable (Resource)value
   2 | Unmatched return validateEFeatureMapEntry((FeatureMap.Entry)value,diagnostics,context);
   3 | Unmatched return validateEResourceSet((ResourceSet)value,diagnostics,context);
   4 | Unmatched return validateEFloat(((Float)value).floatValue(),diagnostics,context);
   5 | Unmatched return validateEShort(((Short)value).shortValue(),diagnostics,context);