if (eContainer instanceof EReference) { // The classifier of an references's generic type must be a class. // if (diagnostics == null) { return false; } else { result = false; diagnostics.add (createDiagnostic (Diagnostic.ERROR, DIAGNOSTIC_SOURCE, CONSISTENT_TYPE_DATA_TYPE_NOT_PERMITTED, "_UI_EReferenceNoClass_diagnostic", null, new Object[] { eGenericType }, context)); } }
if (eSuperType.getInstanceClassName() == "java.util.Map$Entry") { if (diagnostics == null) { return false; } else { result = false; diagnostics.add (createDiagnostic (Diagnostic.ERROR, DIAGNOSTIC_SOURCE, WELL_FORMED_MAP_ENTRY_NO_INSTANCE_CLASS_NAME, "_UI_EClassNotWellFormedMapEntryNoInstanceClassName_diagnostic", null, new Object[] { eClass }, 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_ConsistentType(EGenericType, DiagnosticChain, Map) Method name: boolean validateEClass_WellFormedMapEntryClass(EClass, DiagnosticChain, Map)
Number of AST nodes: 5 Number of AST nodes: 5
1
if (eContainer instanceof EReference)
1
if (e
2
            {
3
              // The classifier of an references's generic type must be a class.
4
              //
5
    
2
SuperType.getInstanceClassName() == "java.util.Map$Entry")
3
        {
6
          if (diagnostics == null)
4
          if (diagnostics == null)
7
              {
5
          
8
    
6
{
9
            return false;
7
            return false;
10
              }
8
          
11
    
9
}
12
          else
10
          else
13
              {
11
          {
14
                result = false;
12
            result = false;
15
                diagnostics.add
13
            diagnostics.add
16
                  (createDiagnostic
14
              (createDiagnostic
17
                    (Diagnostic.ERROR,
15
                (Diagnostic.ERROR,
18
                     DIAGNOSTIC_SOURCE,
16
                 DIAGNOSTIC_SOURCE,
19
                     CONSISTENT_TYPE_DATA_TYPE_NOT_PERMITTED,
17
                 
20
                     "_UI_ERefere
18
WELL_FORMED_MAP_ENTRY_NO_INSTANCE_CLASS_NAME,
21
nceNoClass_diagnostic",
19
                 "_UI_EClassNotWellFormedMapEntryNoInstanceClassName_diagnostic",
22
                     null,
20
                 null,
23
                     new Object[] { eGenericType },
21
                 new Object[] { e
24
    
22
Class },
25
                 context));
23
                 context));
26
              }
24
          
27
    
25
}
28
        }
26
        }
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 declared in the same class
Number of node comparisons17
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)1.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    56
    if (diagnostics == null)
    17
    if (diagnostics == null)
    57
    return false;
    57
    return false;
    18
    return false;
    Preondition Violations
    Conditional return false;
    Conditional return false;
    18
    return false;
    else
    else
    58
    result = false;
    19
    result = false;
                                                                                                                                                                                                                                                                                                                                                                                                                                                      
    20
    diagnostics.add(createDiagnostic(Diagnostic.ERROR, DIAGNOSTIC_SOURCE, WELL_FORMED_MAP_ENTRY_NO_INSTANCE_CLASS_NAME, "_UI_EClassNotWellFormedMapEntryNoInstanceClassName_diagnostic", null, new Object[] {eClass}, context));
    Preondition Violations
    Unmatched statement diagnostics.add(createDiagnostic(Diagnostic.ERROR,DIAGNOSTIC_SOURCE,WELL_FORMED_MAP_ENTRY_NO_INSTANCE_CLASS_NAME,"_UI_EClassNotWellFormedMapEntryNoInstanceClassName_diagnostic",null,new Object[]{eClass},context)); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    20
    diagnostics.add(createDiagnostic(Diagnostic.ERROR, DIAGNOSTIC_SOURCE, WELL_FORMED_MAP_ENTRY_NO_INSTANCE_CLASS_NAME, "_UI_EClassNotWellFormedMapEntryNoInstanceClassName_diagnostic", null, new Object[] {eClass}, context));
    59
    diagnostics.add(createDiagnostic(Diagnostic.ERROR, DIAGNOSTIC_SOURCE, CONSISTENT_TYPE_DATA_TYPE_NOT_PERMITTED, "_UI_EReferenceNoClass_diagnostic", null, new Object[] {eGenericType}, context));
    59
    diagnostics.add(createDiagnostic(Diagnostic.ERROR, DIAGNOSTIC_SOURCE, CONSISTENT_TYPE_DATA_TYPE_NOT_PERMITTED, "_UI_EReferenceNoClass_diagnostic", null, new Object[] {eGenericType}, context));
    Preondition Violations
    Unmatched statement diagnostics.add(createDiagnostic(Diagnostic.ERROR,DIAGNOSTIC_SOURCE,CONSISTENT_TYPE_DATA_TYPE_NOT_PERMITTED,"_UI_EReferenceNoClass_diagnostic",null,new Object[]{eGenericType},context)); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                                                                                                                                                                                                                                                                                                                              
    Precondition Violations (4)
    Row Violation
    1Unmatched statement diagnostics.add(createDiagnostic(Diagnostic.ERROR,DIAGNOSTIC_SOURCE,WELL_FORMED_MAP_ENTRY_NO_INSTANCE_CLASS_NAME,"_UI_EClassNotWellFormedMapEntryNoInstanceClassName_diagnostic",null,new Object[]{eClass},context)); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2Unmatched statement diagnostics.add(createDiagnostic(Diagnostic.ERROR,DIAGNOSTIC_SOURCE,CONSISTENT_TYPE_DATA_TYPE_NOT_PERMITTED,"_UI_EReferenceNoClass_diagnostic",null,new Object[]{eGenericType},context)); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    3Conditional return false;
    4Conditional return false;