EStructuralFeature openFeature = ExtendedMetaData.INSTANCE.getAffiliation(eClass(), eFeature); if (openFeature != null) { if (!FeatureMapUtil.isFeatureMap(openFeature)) { openFeature = ExtendedMetaData.INSTANCE.getGroup(openFeature); } FeatureMap featureMap = (FeatureMap)eGet(openFeature); ((FeatureMap.Internal)featureMap).set(eFeature, newValue); } else { throw new IllegalArgumentException("The feature '" + eFeature.getName() + "' is not a valid changeable feature"); }
EStructuralFeature openFeature = ExtendedMetaData.INSTANCE.getAffiliation(eClass(), eFeature); if (openFeature != null) { if (!FeatureMapUtil.isFeatureMap(openFeature)) { openFeature = ExtendedMetaData.INSTANCE.getGroup(openFeature); } FeatureMap featureMap = (FeatureMap)eGet(openFeature); ((FeatureMap.Internal)featureMap).unset(eFeature); } else { throw new IllegalArgumentException("The feature '" + eFeature.getName() + "' is not a valid changeable feature"); }
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/impl/BasicEObjectImpl.java File path: /emf-2.4.1/src/org/eclipse/emf/ecore/impl/BasicEObjectImpl.java
Method name: void eOpenSet(EStructuralFeature, Object) Method name: void eOpenUnset(EStructuralFeature)
Number of AST nodes: 7 Number of AST nodes: 7
1
EStructuralFeature openFeature = ExtendedMetaData.INSTANCE.getAffiliation(eClass(), eFeature);
1
EStructuralFeature openFeature = ExtendedMetaData.INSTANCE.getAffiliation(eClass(), eFeature);
2
    if (openFeature != null)
2
    if (openFeature != null)
3
    {
3
    {
4
      if (!FeatureMapUtil.isFeatureMap(openFeature))
4
      if (!FeatureMapUtil.isFeatureMap(openFeature))
5
      {
5
      {
6
        openFeature = ExtendedMetaData.INSTANCE.getGroup(openFeature);
6
        openFeature = ExtendedMetaData.INSTANCE.getGroup(openFeature);
7
      }
7
      }
8
      FeatureMap featureMap = (FeatureMap)eGet(openFeature);
8
      FeatureMap featureMap = (FeatureMap)eGet(openFeature);
9
      ((FeatureMap.Internal)featureMap).set(eFeature, newValue);
9
      ((FeatureMap.Internal)featureMap).unset(eFeature);
10
    }
10
    }
11
    else
11
    else
12
    {
12
    {
13
      throw new IllegalArgumentException("The feature '" + eFeature.getName() + "' is not a valid changeable feature");
13
      throw new IllegalArgumentException("The feature '" + eFeature.getName() + "' is not a valid changeable feature");
14
    }
14
    }
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)1.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    EStructuralFeature openFeature = ExtendedMetaData.INSTANCE.getAffiliation(eClass(), eFeature);
    1
    EStructuralFeature openFeature = ExtendedMetaData.INSTANCE.getAffiliation(eClass(), eFeature);
    2
    if (openFeature != null)
    2
    if (openFeature != null)
    3
    if (!FeatureMapUtil.isFeatureMap(openFeature))
    3
    if (!FeatureMapUtil.isFeatureMap(openFeature))
    4
    openFeature = ExtendedMetaData.INSTANCE.getGroup(openFeature);
    4
    openFeature = ExtendedMetaData.INSTANCE.getGroup(openFeature);
    5
    FeatureMap featureMap = (FeatureMap)eGet(openFeature);
    5
    FeatureMap featureMap = (FeatureMap)eGet(openFeature);
    6
    ((FeatureMap.Internal)featureMap).set(eFeature, newValue);
    6
    ((FeatureMap.Internal)featureMap).set(eFeature, newValue);
    6
    ((FeatureMap.Internal)featureMap).unset(eFeature);
    Differences
    Expression1Expression2Difference
    setunsetMETHOD_INVOCATION_NAME_MISMATCH
    ((FeatureMap.Internal)featureMap).set(eFeature,newValue)((FeatureMap.Internal)featureMap).unset(eFeature)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression ((FeatureMap.Internal)featureMap).set(eFeature,newValue) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression ((FeatureMap.Internal)featureMap).unset(eFeature) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression ((FeatureMap.Internal)featureMap).set(eFeature,newValue) is a void method call, and thus it cannot be parameterized
    Expression ((FeatureMap.Internal)featureMap).unset(eFeature) is a void method call, and thus it cannot be parameterized
    Expression ((FeatureMap.Internal)featureMap).set(eFeature,newValue) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression ((FeatureMap.Internal)featureMap).unset(eFeature) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression ((FeatureMap.Internal)featureMap).set(eFeature,newValue) is a void method call, and thus it cannot be parameterized
    Expression ((FeatureMap.Internal)featureMap).unset(eFeature) is a void method call, and thus it cannot be parameterized
    6
    ((FeatureMap.Internal)featureMap).unset(eFeature);
    else
    else
    7
    throw new IllegalArgumentException("The feature '" + eFeature.getName() + "' is not a valid changeable feature");
    7
    throw new IllegalArgumentException("The feature '" + eFeature.getName() + "' is not a valid changeable feature");
    Precondition Violations (8)
    Row Violation
    1Expression ((FeatureMap.Internal)featureMap).set(eFeature,newValue) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression ((FeatureMap.Internal)featureMap).unset(eFeature) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression ((FeatureMap.Internal)featureMap).set(eFeature,newValue) is a void method call, and thus it cannot be parameterized
    4Expression ((FeatureMap.Internal)featureMap).unset(eFeature) is a void method call, and thus it cannot be parameterized
    5Expression ((FeatureMap.Internal)featureMap).set(eFeature,newValue) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression ((FeatureMap.Internal)featureMap).unset(eFeature) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression ((FeatureMap.Internal)featureMap).set(eFeature,newValue) is a void method call, and thus it cannot be parameterized
    8Expression ((FeatureMap.Internal)featureMap).unset(eFeature) is a void method call, and thus it cannot be parameterized