if (affiliation == null) { EAnnotation eAnnotation = getAnnotation(eStructuralFeature, false); if (eAnnotation != null) { eAnnotation.getDetails().remove("affiliation"); } } else { EAnnotation eAnnotation = getAnnotation(eStructuralFeature, true); eAnnotation.getDetails().put ("affiliation", getQualifiedName(getNamespace(eStructuralFeature.getEContainingClass().getEPackage()), affiliation)); } getExtendedMetaData(eStructuralFeature).setAffiliation(affiliation);
if (group == null) { EAnnotation eAnnotation = getAnnotation(eStructuralFeature, false); if (eAnnotation != null) { eAnnotation.getDetails().remove("group"); } } else { EAnnotation eAnnotation = getAnnotation(eStructuralFeature, true); eAnnotation.getDetails().put ("group", getQualifiedName(getNamespace(eStructuralFeature.getEContainingClass().getEPackage()), group)); } getExtendedMetaData(eStructuralFeature).setGroup(group);
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: void setAffiliation(EStructuralFeature, EStructuralFeature) Method name: void setGroup(EStructuralFeature, EStructuralFeature)
Number of AST nodes: 7 Number of AST nodes: 7
1
if (affiliation == null)
1
if (group == null)
2
    {
2
    {
3
      EAnnotation eAnnotation = getAnnotation(eStructuralFeature, false);
3
      EAnnotation eAnnotation = getAnnotation(eStructuralFeature, false);
4
      if (eAnnotation != null)
4
      if (eAnnotation != null)
5
      {
5
      {
6
        eAnnotation.getDetails().remove("affiliation");
6
        eAnnotation.getDetails().remove("group");
7
      }
7
      }
8
    }
8
    }
9
    else
9
    else
10
    {
10
    {
11
      EAnnotation eAnnotation = getAnnotation(eStructuralFeature, true);
11
      EAnnotation eAnnotation = getAnnotation(eStructuralFeature, true);
12
      eAnnotation.getDetails().put
12
      eAnnotation.getDetails().put
13
        ("affiliation", getQualifiedName(getNamespace(eStructuralFeature.getEContainingClass().getEPackage()), affiliation));
13
        ("group", getQualifiedName(getNamespace(eStructuralFeature.getEContainingClass().getEPackage()), group));
14
    }
14
    }
15
    getExtendedMetaData(eStructuralFeature).setAffiliation(affiliation);
15
    getExtendedMetaData(eStructuralFeature).setGroup(group);
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 declared in the same class
Number of node comparisons21
  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)3.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (affiliation == null)
    1
    if (affiliation == null)
    1
    if (group == null)
    Differences
    Expression1Expression2Difference
    affiliationgroupVARIABLE_NAME_MISMATCH
    1
    if (group == null)
    2
    EAnnotation eAnnotation = getAnnotation(eStructuralFeature, false);
    2
    EAnnotation eAnnotation = getAnnotation(eStructuralFeature, false);
    3
    if (eAnnotation != null)
    3
    if (eAnnotation != null)
    4
    eAnnotation.getDetails().remove("affiliation");
    4
    eAnnotation.getDetails().remove("affiliation");
    4
    eAnnotation.getDetails().remove("group");
    Differences
    Expression1Expression2Difference
    "affiliation""group"LITERAL_VALUE_MISMATCH
    4
    eAnnotation.getDetails().remove("group");
    else
    else
    5
    EAnnotation eAnnotation = getAnnotation(eStructuralFeature, true);
    5
    EAnnotation eAnnotation = getAnnotation(eStructuralFeature, true);
    6
    eAnnotation.getDetails().put("affiliation", getQualifiedName(getNamespace(eStructuralFeature.getEContainingClass().getEPackage()), affiliation));
    6
    eAnnotation.getDetails().put("affiliation", getQualifiedName(getNamespace(eStructuralFeature.getEContainingClass().getEPackage()), affiliation));
    6
    eAnnotation.getDetails().put("group", getQualifiedName(getNamespace(eStructuralFeature.getEContainingClass().getEPackage()), group));
    Differences
    Expression1Expression2Difference
    "affiliation""group"LITERAL_VALUE_MISMATCH
    affiliationgroupVARIABLE_NAME_MISMATCH
    6
    eAnnotation.getDetails().put("group", getQualifiedName(getNamespace(eStructuralFeature.getEContainingClass().getEPackage()), group));
    7
    getExtendedMetaData(eStructuralFeature).setAffiliation(affiliation);
    7
    getExtendedMetaData(eStructuralFeature).setAffiliation(affiliation);
    7
    getExtendedMetaData(eStructuralFeature).setGroup(group);
    Differences
    Expression1Expression2Difference
    setAffiliationsetGroupMETHOD_INVOCATION_NAME_MISMATCH
    affiliationgroupVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression getExtendedMetaData(eStructuralFeature).setAffiliation(affiliation) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression getExtendedMetaData(eStructuralFeature).setGroup(group) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression getExtendedMetaData(eStructuralFeature).setAffiliation(affiliation) is a void method call, and thus it cannot be parameterized
    Expression getExtendedMetaData(eStructuralFeature).setGroup(group) is a void method call, and thus it cannot be parameterized
    7
    getExtendedMetaData(eStructuralFeature).setGroup(group);
    Precondition Violations (4)
    Row Violation
    1Expression getExtendedMetaData(eStructuralFeature).setAffiliation(affiliation) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression getExtendedMetaData(eStructuralFeature).setGroup(group) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression getExtendedMetaData(eStructuralFeature).setAffiliation(affiliation) is a void method call, and thus it cannot be parameterized
    4Expression getExtendedMetaData(eStructuralFeature).setGroup(group) is a void method call, and thus it cannot be parameterized