int index = names.indexOf(name); if (index != -1) { if (diagnostics == null) { return false; } else { result = false; ETypeParameter otherETypeParameter = eTypeParameters.get(index); diagnostics.add (createDiagnostic (Diagnostic.ERROR, DIAGNOSTIC_SOURCE, UNIQUE_TYPE_PARAMETER_NAMES, "_UI_UniqueTypeParameterNames_diagnostic", new Object[] { name }, new Object[] { eClassifier, eTypeParameter, otherETypeParameter }, context)); } }
int index = names.indexOf(name); if (index != -1) { if (diagnostics == null) { return false; } else { result = false; ETypeParameter otherETypeParameter = eTypeParameters.get(index); diagnostics.add (createDiagnostic (Diagnostic.ERROR, DIAGNOSTIC_SOURCE, UNIQUE_TYPE_PARAMETER_NAMES, "_UI_UniqueTypeParameterNames_diagnostic", new Object[] { name }, new Object[] { eOperation, eTypeParameter, otherETypeParameter }, 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 validateEClassifier_UniqueTypeParameterNames(EClassifier, DiagnosticChain, Map) Method name: boolean validateEOperation_UniqueTypeParameterNames(EOperation, DiagnosticChain, Map)
Number of AST nodes: 7 Number of AST nodes: 7
1
int index = names.indexOf(name);
1
int index = names.indexOf(name);
2
        if (index != -1)
2
        if (index != -1)
3
        {
3
        {
4
          if (diagnostics == null)
4
          if (diagnostics == null)
5
          {
5
          {
6
            return false;
6
            return false;
7
          }
7
          }
8
          else
8
          else
9
          {
9
          {
10
            result = false;
10
            result = false;
11
            ETypeParameter otherETypeParameter = eTypeParameters.get(index);
11
            ETypeParameter otherETypeParameter = eTypeParameters.get(index);
12
            diagnostics.add
12
            diagnostics.add
13
              (createDiagnostic
13
              (createDiagnostic
14
                (Diagnostic.ERROR,
14
                (Diagnostic.ERROR,
15
                 DIAGNOSTIC_SOURCE,
15
                 DIAGNOSTIC_SOURCE,
16
                 UNIQUE_TYPE_PARAMETER_NAMES,
16
                 UNIQUE_TYPE_PARAMETER_NAMES,
17
                 "_UI_UniqueTypeParameterNames_diagnostic", 
17
                 "_UI_UniqueTypeParameterNames_diagnostic", 
18
                 new Object[] { name },
18
                 new Object[] { name },
19
                 new Object[] { eClassifier, eTypeParameter, otherETypeParameter },
19
                 new Object[] { eOperation, eTypeParameter, otherETypeParameter },
20
                 context));
20
                 context));
21
          }
21
          }
22
        }
22
        }
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.3
Clones locationClones are declared in the same class
Number of node comparisons29
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements7
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)2.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    7
    int index = names.indexOf(name);
    7
    int index = names.indexOf(name);
    8
    if (index != -1)
    8
    if (index != -1)
    9
    if (diagnostics == null)
    9
    if (diagnostics == null)
    10
    return false;
    10
    return false;
    else
    else
    11
    result = false;
    11
    result = false;
    12
    ETypeParameter otherETypeParameter = eTypeParameters.get(index);
    12
    ETypeParameter otherETypeParameter = eTypeParameters.get(index);
    13
    diagnostics.add(createDiagnostic(Diagnostic.ERROR, DIAGNOSTIC_SOURCE, UNIQUE_TYPE_PARAMETER_NAMES, "_UI_UniqueTypeParameterNames_diagnostic", new Object[] {name}, new Object[] {eClassifier, eTypeParameter, otherETypeParameter}, context));
    13
    diagnostics.add(createDiagnostic(Diagnostic.ERROR, DIAGNOSTIC_SOURCE, UNIQUE_TYPE_PARAMETER_NAMES, "_UI_UniqueTypeParameterNames_diagnostic", new Object[] {name}, new Object[] {eClassifier, eTypeParameter, otherETypeParameter}, context));
    13
    diagnostics.add(createDiagnostic(Diagnostic.ERROR, DIAGNOSTIC_SOURCE, UNIQUE_TYPE_PARAMETER_NAMES, "_UI_UniqueTypeParameterNames_diagnostic", new Object[] {name}, new Object[] {eOperation, eTypeParameter, otherETypeParameter}, context));
    Differences
    Expression1Expression2Difference
    eClassifiereOperationVARIABLE_NAME_MISMATCH
    org.eclipse.emf.ecore.EClassifierorg.eclipse.emf.ecore.EOperationVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.ecore.EClassifier of variable eClassifier does not match with type org.eclipse.emf.ecore.EOperation of variable eOperation
    • Make classes org.eclipse.emf.ecore.EClassifier and org.eclipse.emf.ecore.EOperation extend a common superclass
    13
    diagnostics.add(createDiagnostic(Diagnostic.ERROR, DIAGNOSTIC_SOURCE, UNIQUE_TYPE_PARAMETER_NAMES, "_UI_UniqueTypeParameterNames_diagnostic", new Object[] {name}, new Object[] {eOperation, eTypeParameter, otherETypeParameter}, context));
    Precondition Violations (1)
    Row Violation
    1Type org.eclipse.emf.ecore.EClassifier of variable eClassifier does not match with type org.eclipse.emf.ecore.EOperation of variable eOperation