int index = superTypes.indexOf(eClassifier); if (index != -1) { if (diagnostics == null) { return false; } else { result = false; diagnostics.add (createDiagnostic (Diagnostic.ERROR, DIAGNOSTIC_SOURCE, CONSISTENT_SUPER_TYPES_CONFLICT, "_UI_EClassConsistentSuperTypes_diagnostic", new Object [] { getObjectLabel(eClassifier, context) }, new Object[] { eClass, eGenericSuperType, eAllGenericSuperTypes.get(index) }, context)); } }
int index = superTypes.indexOf(eClassifier); if (index != -1) { if (diagnostics == null) { return false; } else { result = false; diagnostics.add (createDiagnostic (Diagnostic.ERROR, DIAGNOSTIC_SOURCE, CONSISTENT_SUPER_TYPES_DUPLICATE, "_UI_EClassNoDuplicateSuperTypes_diagnostic", new Object [] { eGenericSuperTypes.indexOf(eGenericSuperType), index }, new Object[] { eClass, eGenericSuperType, eGenericSuperTypes.get(index) }, 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 validateEClass_ConsistentSuperTypes(EClass, DiagnosticChain, Map) Method name: boolean validateEClass_ConsistentSuperTypes(EClass, DiagnosticChain, Map)
Number of AST nodes: 6 Number of AST nodes: 6
1
int index = superTypes.indexOf(eClassifier);
1
int index = superTypes.indexOf(eClassifier);
2
          if (index != -1)
2
        if (index != -1)
3
          {
3
        
4
  
4
{
5
          if (diagnostics == null)
5
          if (diagnostics == null)
6
            {
6
          {
7
              return false;
7
            return false;
8
            }
8
          }
9
            else
9
          else
10
            {
10
          {
11
              result = false;
11
            result = false;
12
              diagnostics.add
12
            diagnostics.add
13
                (createDiagnostic
13
              (createDiagnostic
14
                  (Diagnostic.ERROR,
14
                (Diagnostic.ERROR,
15
                   DIAGNOSTIC_SOURCE,
15
                 DIAGNOSTIC_SOURCE,
16
                   CONSISTENT_SUPER_TYPES_CONFLICT,
16
                 CONSISTENT_SUPER_TYPES_
17
  
17
DUPLICATE,
18
                 "_UI_EClassConsistentSuperTypes_diagnostic",
18
                 "_UI_EClassNoDuplicateSuperTypes_diagnostic",
19
                   new Object [] { getObjectLabel(eClassifier, context) },
19
                 new Object [] { eGenericSuperTypes.indexOf(eGenericSuperType), index },
20
                   new Object[] { eClass, eGenericSuperType,  eAllGenericSuperTypes.get(index) },
20
                 new Object[] { eClass, eGenericSuperType,  eGenericSuperTypes.get(index) },
21
                   context));
21
                 context));
22
            }
22
          
23
  
23
}
24
        }
24
        }
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.2
Clones locationClones are in the same method
Number of node comparisons21
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements6
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1524.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    20
    int index = superTypes.indexOf(eClassifier);
    7
    int index = superTypes.indexOf(eClassifier);
    21
    if (index != -1)
    8
    if (index != -1)
    22
    if (diagnostics == null)
    9
    if (diagnostics == null)
    23
    return false;
    23
    return false;
    10
    return false;
    Preondition Violations
    Conditional return false;
    Conditional return false;
    10
    return false;
    else
    else
    24
    result = false;
    11
    result = false;
    25
    diagnostics.add(createDiagnostic(Diagnostic.ERROR, DIAGNOSTIC_SOURCE, CONSISTENT_SUPER_TYPES_CONFLICT, "_UI_EClassConsistentSuperTypes_diagnostic", new Object[] {getObjectLabel(eClassifier, context)}, new Object[] {eClass, eGenericSuperType, eAllGenericSuperTypes.get(index)}, context));
    25
    diagnostics.add(createDiagnostic(Diagnostic.ERROR, DIAGNOSTIC_SOURCE, CONSISTENT_SUPER_TYPES_CONFLICT, "_UI_EClassConsistentSuperTypes_diagnostic", new Object[] {getObjectLabel(eClassifier, context)}, new Object[] {eClass, eGenericSuperType, eAllGenericSuperTypes.get(index)}, context));
    12
    diagnostics.add(createDiagnostic(Diagnostic.ERROR, DIAGNOSTIC_SOURCE, CONSISTENT_SUPER_TYPES_DUPLICATE, "_UI_EClassNoDuplicateSuperTypes_diagnostic", new Object[] {eGenericSuperTypes.indexOf(eGenericSuperType), index}, new Object[] {eClass, eGenericSuperType, eGenericSuperTypes.get(index)}, context));
    Differences
    Expression1Expression2Difference
    CONSISTENT_SUPER_TYPES_CONFLICTCONSISTENT_SUPER_TYPES_DUPLICATEVARIABLE_NAME_MISMATCH
    "_UI_EClassConsistentSuperTypes_diagnostic""_UI_EClassNoDuplicateSuperTypes_diagnostic"LITERAL_VALUE_MISMATCH
    {getObjectLabel(eClassifier,context)}{eGenericSuperTypes.indexOf(eGenericSuperType),index}ARRAY_INITIALIZER_EXPRESSION_NUMBER_MISMATCH
    eAllGenericSuperTypeseGenericSuperTypesVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression new Object[]{eGenericSuperTypes.indexOf(eGenericSuperType),index} cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12
    diagnostics.add(createDiagnostic(Diagnostic.ERROR, DIAGNOSTIC_SOURCE, CONSISTENT_SUPER_TYPES_DUPLICATE, "_UI_EClassNoDuplicateSuperTypes_diagnostic", new Object[] {eGenericSuperTypes.indexOf(eGenericSuperType), index}, new Object[] {eClass, eGenericSuperType, eGenericSuperTypes.get(index)}, context));
    Precondition Violations (3)
    Row Violation
    1Expression new Object[]{eGenericSuperTypes.indexOf(eGenericSuperType),index} cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Conditional return false;
    3Conditional return false;