EAnnotation eAnnotation = getAnnotation(eDataType, false); if (eAnnotation != null) { EMap<String, String> details = eAnnotation.getDetails(); String baseType = details.get("baseType"); if (baseType != null) { int index = baseType.lastIndexOf("#"); EClassifier type = index == -1 ? getType(eDataType.getEPackage(), baseType) : index == 0 ? getType((String)null, baseType.substring(1)) : getType(baseType.substring(0, index), baseType.substring(index + 1)); if (type instanceof EDataType) { return (EDataType)type; } } } return null;
EAnnotation eAnnotation = getAnnotation(eDataType, false); if (eAnnotation != null) { EMap<String, String> details = eAnnotation.getDetails(); String itemType = details.get("itemType"); if (itemType != null) { int index = itemType.lastIndexOf("#"); EClassifier type = index == -1 ? getType(eDataType.getEPackage(), itemType) : index == 0 ? getType((String)null, itemType.substring(1)) : getType(itemType.substring(0, index), itemType.substring(index + 1)); if (type instanceof EDataType) { return (EDataType)type; } } } return null;
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/BasicExtendedMetaData.java File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/BasicExtendedMetaData.java
Method name: EDataType basicGetBaseType(EDataType) Method name: EDataType basicGetItemType(EDataType)
Number of AST nodes: 10 Number of AST nodes: 10
1
EAnnotation eAnnotation = getAnnotation(eDataType, false);
1
EAnnotation eAnnotation = getAnnotation(eDataType, false);
2
    if (eAnnotation != null)
2
    if (eAnnotation != null)
3
    {
3
    {
4
      EMap<String, String> details = eAnnotation.getDetails();
4
      EMap<String, String> details = eAnnotation.getDetails();
5
      String baseType = details.get("baseType");
5
      String itemType = details.get("itemType");
6
      if (baseType != null)
6
      if (itemType != null)
7
      {
7
      {
8
        int index = baseType.lastIndexOf("#");
8
        int index = itemType.lastIndexOf("#");
9
        EClassifier type = 
9
        EClassifier type = 
10
          index == -1 ?
10
          index == -1 ?
11
            getType(eDataType.getEPackage(), baseType) :
11
            getType(eDataType.getEPackage(), itemType) :
12
            index == 0 ?
12
            index == 0 ?
13
              getType((String)null, baseType.substring(1)) :
13
              getType((String)null, itemType.substring(1)) :
14
              getType(baseType.substring(0, index), baseType.substring(index + 1));
14
              getType(itemType.substring(0, index), itemType.substring(index + 1));
15
        if (type instanceof EDataType)
15
        if (type instanceof EDataType)
16
        {
16
        {
17
          return (EDataType)type;
17
          return (EDataType)type;
18
        }
18
        }
19
      }
19
      }
20
    }
20
    }
21
    return null;
21
    return null;
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.2
Clones locationClones are declared in the same class
Number of node comparisons26
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements10
    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
    1
    EAnnotation eAnnotation = getAnnotation(eDataType, false);
    1
    EAnnotation eAnnotation = getAnnotation(eDataType, false);
    2
    if (eAnnotation != null)
    2
    if (eAnnotation != null)
    3
    EMap<String, String> details = eAnnotation.getDetails();
    3
    EMap<String, String> details = eAnnotation.getDetails();
    4
    String baseType = details.get("baseType");
    4
    String baseType = details.get("baseType");
    4
    String itemType = details.get("itemType");
    Differences
    Expression1Expression2Difference
    baseTypeitemTypeVARIABLE_NAME_MISMATCH
    "baseType""itemType"LITERAL_VALUE_MISMATCH
    4
    String itemType = details.get("itemType");
    5
    if (baseType != null)
    5
    if (baseType != null)
    5
    if (itemType != null)
    Differences
    Expression1Expression2Difference
    baseTypeitemTypeVARIABLE_NAME_MISMATCH
    5
    if (itemType != null)
    6
    int index = baseType.lastIndexOf("#");
    6
    int index = baseType.lastIndexOf("#");
    6
    int index = itemType.lastIndexOf("#");
    Differences
    Expression1Expression2Difference
    baseTypeitemTypeVARIABLE_NAME_MISMATCH
    6
    int index = itemType.lastIndexOf("#");
    7
    EClassifier type = index == -1 ? getType(eDataType.getEPackage(), baseType) : index == 0 ? getType((String)null, baseType.substring(1)) : getType(baseType.substring(0, index), baseType.substring(index + 1));
    7
    EClassifier type = index == -1 ? getType(eDataType.getEPackage(), baseType) : index == 0 ? getType((String)null, baseType.substring(1)) : getType(baseType.substring(0, index), baseType.substring(index + 1));
    7
    EClassifier type = index == -1 ? getType(eDataType.getEPackage(), itemType) : index == 0 ? getType((String)null, itemType.substring(1)) : getType(itemType.substring(0, index), itemType.substring(index + 1));
    Differences
    Expression1Expression2Difference
    baseTypeitemTypeVARIABLE_NAME_MISMATCH
    baseTypeitemTypeVARIABLE_NAME_MISMATCH
    baseTypeitemTypeVARIABLE_NAME_MISMATCH
    baseTypeitemTypeVARIABLE_NAME_MISMATCH
    7
    EClassifier type = index == -1 ? getType(eDataType.getEPackage(), itemType) : index == 0 ? getType((String)null, itemType.substring(1)) : getType(itemType.substring(0, index), itemType.substring(index + 1));
    8
    if (type instanceof EDataType)
    8
    if (type instanceof EDataType)
    9
    return (EDataType)type;
    9
    return (EDataType)type;
    10
    return null;
    10
    return null;
    Precondition Violations (0)
    Row Violation