11436-9-10

if (diagnostics == null) { return false; } else { result = false; diagnostics.add (createDiagnostic (Diagnostic.ERROR, DIAGNOSTIC_SOURCE, CONSISTENT_ARGUMENTS_INCORRECT_NUMBER, "_UI_EGenericTypeIncorrectArguments_diagnostic", new Object [] { eClassifier.getName(), eTypeArgumentSize, eTypeParameterSize }, new Object[] { eGenericType }, context)); }
if (diagnostics == null) { return false; } else { result = false; diagnostics.add (createDiagnostic (Diagnostic.ERROR, DIAGNOSTIC_SOURCE, CONSISTENT_ARGUMENTS_INVALID_SUBSTITUTION, "_UI_EGenericTypeArgumentInvalidSubstitution_diagnostic", new Object [] { getObjectLabel(eTypeArgument, context), getObjectLabel(eTypeParameter, context) }, new Object[] { eGenericType, eTypeArgument, eTypeParameter }, context)); }

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 validateEGenericType_ConsistentArguments(EGenericType, DiagnosticChain, Map)` |  | Method name: `boolean validateEGenericType_ConsistentArguments(EGenericType, DiagnosticChain, Map)`
Number of AST nodes: 4 |  | Number of AST nodes: 4

1

    if (diagnostics == null)↵

1

    if (diagnostics == null)↵

2

            {↵

2

            ↵

3

        {↵

3

              return false;↵

4

                  return false;↵

4

            }↵

5

              ↵

6

      }↵

5

            else↵

7

                else↵

6

            {↵

8

                {↵

7

              result = false;↵

9

                  result = false;↵

8

              diagnostics.add↵

10

                  diagnostics.add↵

9

                (createDiagnostic↵

11

                    (createDiagnostic↵

10

                  (Diagnostic.ERROR,↵

12

                      (Diagnostic.ERROR,↵

11

                   DIAGNOSTIC_SOURCE,↵

13

                       DIAGNOSTIC_SOURCE,↵

12

                   CONSISTENT_ARGUMENTS_INCORRECT_NUMBER,↵

14

                       CONSISTENT_ARGUMENTS_IN↵

15

    VALID_SUBSTITUTION,↵

13

                   "_UI_EGenericTypeIncorrectArguments_diagnostic", ↵

16

                       "_UI_EGenericTypeArgumentInvalidSubstitution_diagnostic", ↵

14

                   new Object [] { eClassifier.getName(), eTypeArgumentSize, eTypeParameterSize },↵

17

                        new Object [] ↵

18

                        { ↵

19

                          getObjectLabel(eTypeArgument, context), ↵

20

                          getObjectLabel(eTypeParameter, context) ↵

21

                        },↵

15

                   new Object[] { eGenericType },↵

22

                       new Object[] { eGenericType↵

23

    , eTypeArgument, eTypeParameter },↵

16

                   context));↵

24

                       context));↵

25

        ↵

17

            }

26

                }

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.1
Clones location | Clones are in the same method
Number of node comparisons | 16

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 4
   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) | 67.0
   Clone type | Type 2

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

   20

       if (diagnostics == null)

   30

       if (diagnostics == null)

   21

       return false;

   21 | return false;
   31 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   31

       return false;

       else

       else

   22

       result = false;

   32

       result = false;

   23

       diagnostics.add(createDiagnostic(Diagnostic.ERROR, DIAGNOSTIC_SOURCE, CONSISTENT_ARGUMENTS_INCORRECT_NUMBER, "_UI_EGenericTypeIncorrectArguments_diagnostic", new Object[] {eClassifier.getName(), eTypeArgumentSize, eTypeParameterSize}, new Object[] {eGenericType}, context));

   23 | diagnostics.add(createDiagnostic(Diagnostic.ERROR, DIAGNOSTIC_SOURCE, CONSISTENT_ARGUMENTS_INCORRECT_NUMBER, "_UI_EGenericTypeIncorrectArguments_diagnostic", new Object[] {eClassifier.getName(), eTypeArgumentSize, eTypeParameterSize}, new Object[] {eGenericType}, context));
   33 | diagnostics.add(createDiagnostic(Diagnostic.ERROR, DIAGNOSTIC_SOURCE, CONSISTENT_ARGUMENTS_INVALID_SUBSTITUTION, "_UI_EGenericTypeArgumentInvalidSubstitution_diagnostic", new Object[] {getObjectLabel(eTypeArgument, context), getObjectLabel(eTypeParameter, context)}, new Object[] {eGenericType, eTypeArgument, eTypeParameter}, context));

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   CONSISTENT_ARGUMENTS_INCORRECT_NUMBER | CONSISTENT_ARGUMENTS_INVALID_SUBSTITUTION | VARIABLE_NAME_MISMATCH
   "_UI_EGenericTypeIncorrectArguments_diagnostic" | "_UI_EGenericTypeArgumentInvalidSubstitution_diagnostic" | LITERAL_VALUE_MISMATCH
   {eClassifier.getName(),eTypeArgumentSize,eTypeParameterSize} | {getObjectLabel(eTypeArgument,context),getObjectLabel(eTypeParameter,context)} | ARRAY_INITIALIZER_EXPRESSION_NUMBER_MISMATCH
   {eGenericType} | {eGenericType,eTypeArgument,eTypeParameter} | ARRAY_INITIALIZER_EXPRESSION_NUMBER_MISMATCH

   33

       diagnostics.add(createDiagnostic(Diagnostic.ERROR, DIAGNOSTIC_SOURCE, CONSISTENT_ARGUMENTS_INVALID_SUBSTITUTION, "_UI_EGenericTypeArgumentInvalidSubstitution_diagnostic", new Object[] {getObjectLabel(eTypeArgument, context), getObjectLabel(eTypeParameter, context)}, new Object[] {eGenericType, eTypeArgument, eTypeParameter}, context));

   Precondition Violations (2)
   Row | Violation
   --- | ---
   1 | Conditional return false;
   2 | Conditional return false;