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)); }
if (diagnostics == null) { return false; } else { result = false; diagnostics.add (createDiagnostic (Diagnostic.ERROR, DIAGNOSTIC_SOURCE, CONSISTENT_ARGUMENTS_NONE_ALLOWED, "_UI_EGenericTypeNoArguments_diagnostic", null, new Object[] { eGenericType }, 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
{
4
          return false;
4
          return false;
5
            }
5
        }
6
            else
6
        else
7
            {
7
        {
8
              result = false;
8
          result = false;
9
              diagnostics.add
9
          diagnostics.add
10
                (createDiagnostic
10
            (createDiagnostic
11
                  (Diagnostic.ERROR,
11
              (Diagnostic.ERROR,
12
                   DIAGNOSTIC_SOURCE,
12
               DIAGNOSTIC_SOURCE,
13
                   CONSISTENT_ARGUMENTS_INVALID_SUBSTITUTION,
13
               CONSISTENT_ARGUMENTS_
14
    
14
NONE_ALLOWED,
15
               "_UI_EGenericTypeArgumentInvalidSubstitution_diagnostic", 
15
               "_UI_EGenericTypeNoArguments_diagnostic",
16
 
17
                   new Object [] 
16
               
18
                    { 
19
                      getObjectLabel(eTypeArgument, context), 
20
                      getObjectLabel(eTypeParameter, context) 
21
                    },
22
                   new Object[] { eGenericType, eTypeArgument, eTypeParameter },
23
    
17
null,
18
               new Object[] { eGenericType },
24
               context));
19
               context));
25
    
20
    
26
            }
21
    }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.1
Clones locationClones are in the same method
Number of node comparisons16
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)6.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    30
    if (diagnostics == null)
    7
    if (diagnostics == null)
    31
    return false;
    31
    return false;
    8
    return false;
    Preondition Violations
    Conditional return false;
    Conditional return false;
    8
    return false;
    else
    else
    32
    result = false;
    9
    result = false;
    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));
    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));
    10
    diagnostics.add(createDiagnostic(Diagnostic.ERROR, DIAGNOSTIC_SOURCE, CONSISTENT_ARGUMENTS_NONE_ALLOWED, "_UI_EGenericTypeNoArguments_diagnostic", null, new Object[] {eGenericType}, context));
    Differences
    Expression1Expression2Difference
    CONSISTENT_ARGUMENTS_INVALID_SUBSTITUTIONCONSISTENT_ARGUMENTS_NONE_ALLOWEDVARIABLE_NAME_MISMATCH
    "_UI_EGenericTypeArgumentInvalidSubstitution_diagnostic""_UI_EGenericTypeNoArguments_diagnostic"LITERAL_VALUE_MISMATCH
    new Object[]{getObjectLabel(eTypeArgument,context),getObjectLabel(eTypeParameter,context)}nullTYPE_COMPATIBLE_REPLACEMENT
    {eGenericType,eTypeArgument,eTypeParameter}{eGenericType}ARRAY_INITIALIZER_EXPRESSION_NUMBER_MISMATCH
    10
    diagnostics.add(createDiagnostic(Diagnostic.ERROR, DIAGNOSTIC_SOURCE, CONSISTENT_ARGUMENTS_NONE_ALLOWED, "_UI_EGenericTypeNoArguments_diagnostic", null, new Object[] {eGenericType}, context));
    Precondition Violations (2)
    Row Violation
    1Conditional return false;
    2Conditional return false;