switch (featureID) { case ChangePackage.RESOURCE_CHANGE__RESOURCE_URI: setResourceURI(RESOURCE_URI_EDEFAULT); return; case ChangePackage.RESOURCE_CHANGE__RESOURCE: setResource(RESOURCE_EDEFAULT); return; case ChangePackage.RESOURCE_CHANGE__LIST_CHANGES: getListChanges().clear(); return; } super.eUnset(featureID);
switch (featureID) { case Ecore2XMLPackage.XML_MAP__ID_ATTRIBUTE_NAME: setIDAttributeName(ID_ATTRIBUTE_NAME_EDEFAULT); return; case Ecore2XMLPackage.XML_MAP__ECORE_TO_XML_INFO: getEcoreToXMLInfo().clear(); return; case Ecore2XMLPackage.XML_MAP__NO_NAMESPACE_PACKAGE: setNoNamespacePackage((EPackage)null); return; } super.eUnset(featureID);
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/change/impl/ResourceChangeImpl.java File path: /emf-2.4.1/src/org/eclipse/emf/mapping/ecore2xml/impl/XMLMapImpl.java
Method name: void eUnset(int) Method name: void eUnset(int)
Number of AST nodes: 11 Number of AST nodes: 11
1
switch (featureID)
1
switch (featureID)
2
    {
2
    {
3
      case ChangePackage.RESOURCE_CHANGE__RESOURCE_URI:
3
      case 
4
        setResourceURI(RESOURCE_URI
4
Ecore2XMLPackage.XML_MAP__ID_ATTRIBUTE_NAME:
5
_EDEFAULT);
5
        setIDAttributeName(ID_ATTRIBUTE_NAME_EDEFAULT);
6
        return;
6
        return;
7
      case ChangePackage.RESOURCE_CHANGE__RESOURCE:
7
      case Ecore2XMLPackage.XML_MAP__ECORE_TO_XML_INFO:
8
        setResource(RESOURCE_EDEFAULT);
8
        getEcoreToXMLInfo().clear();
9
        return;
9
        return;
10
      case ChangePackage.RESOURCE_CHANGE__LIST_CHANGES:
10
      case Ecore2XMLPackage.XML_MAP__NO_NAMESPACE_PACKAGE:
11
        getListChanges().clear();
11
        setNoNamespacePackage((EPackage)null);
12
        return;
12
        return;
13
    }
13
    }
14
    super.eUnset(featureID);
14
    super.eUnset(featureID);
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 in different classes having the same super class
Number of node comparisons56
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements11
    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.3
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    switch (featureID)
    1
    switch (featureID)
    2
    case ChangePackage.RESOURCE_CHANGE__RESOURCE_URI:
    2
    case ChangePackage.RESOURCE_CHANGE__RESOURCE_URI:
    2
    case Ecore2XMLPackage.XML_MAP__ID_ATTRIBUTE_NAME:
    Differences
    Expression1Expression2Difference
    org.eclipse.emf.ecore.change.ChangePackageorg.eclipse.emf.mapping.ecore2xml.Ecore2XMLPackageVARIABLE_TYPE_MISMATCH
    RESOURCE_CHANGE__RESOURCE_URIXML_MAP__ID_ATTRIBUTE_NAMEVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.ecore.change.ChangePackage of variable ChangePackage does not match with type org.eclipse.emf.mapping.ecore2xml.Ecore2XMLPackage of variable Ecore2XMLPackage
    • Make classes org.eclipse.emf.ecore.change.ChangePackage and org.eclipse.emf.mapping.ecore2xml.Ecore2XMLPackage extend a common superclass
    2
    case Ecore2XMLPackage.XML_MAP__ID_ATTRIBUTE_NAME:
    3
    setResourceURI(RESOURCE_URI_EDEFAULT);
    3
    setResourceURI(RESOURCE_URI_EDEFAULT);
    3
    setIDAttributeName(ID_ATTRIBUTE_NAME_EDEFAULT);
    Differences
    Expression1Expression2Difference
    setResourceURIsetIDAttributeNameMETHOD_INVOCATION_NAME_MISMATCH
    RESOURCE_URI_EDEFAULTID_ATTRIBUTE_NAME_EDEFAULTVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression setResourceURI(RESOURCE_URI_EDEFAULT) is a void method call, and thus it cannot be parameterized
    Expression setIDAttributeName(ID_ATTRIBUTE_NAME_EDEFAULT) is a void method call, and thus it cannot be parameterized
    3
    setIDAttributeName(ID_ATTRIBUTE_NAME_EDEFAULT);
    4
    return;
    4
    return;
    5
    case ChangePackage.RESOURCE_CHANGE__RESOURCE:
    5
    case ChangePackage.RESOURCE_CHANGE__RESOURCE:
    5
    case Ecore2XMLPackage.XML_MAP__ECORE_TO_XML_INFO:
    Differences
    Expression1Expression2Difference
    org.eclipse.emf.ecore.change.ChangePackageorg.eclipse.emf.mapping.ecore2xml.Ecore2XMLPackageVARIABLE_TYPE_MISMATCH
    RESOURCE_CHANGE__RESOURCEXML_MAP__ECORE_TO_XML_INFOVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.ecore.change.ChangePackage of variable ChangePackage does not match with type org.eclipse.emf.mapping.ecore2xml.Ecore2XMLPackage of variable Ecore2XMLPackage
    • Make classes org.eclipse.emf.ecore.change.ChangePackage and org.eclipse.emf.mapping.ecore2xml.Ecore2XMLPackage extend a common superclass
    5
    case Ecore2XMLPackage.XML_MAP__ECORE_TO_XML_INFO:
    6
    setResource(RESOURCE_EDEFAULT);
    6
    setResource(RESOURCE_EDEFAULT);
    6
    getEcoreToXMLInfo().clear();
    Differences
    Expression1Expression2Difference
    setResourceclearMETHOD_INVOCATION_NAME_MISMATCH
    setResource(RESOURCE_EDEFAULT)getEcoreToXMLInfo().clear()ARGUMENT_NUMBER_MISMATCH
    getEcoreToXMLInfo()MISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression setResource(RESOURCE_EDEFAULT) is a void method call, and thus it cannot be parameterized
    Expression getEcoreToXMLInfo().clear() is a void method call, and thus it cannot be parameterized
    Expression setResource(RESOURCE_EDEFAULT) is a void method call, and thus it cannot be parameterized
    Expression getEcoreToXMLInfo().clear() is a void method call, and thus it cannot be parameterized
    6
    getEcoreToXMLInfo().clear();
    7
    return;
    7
    return;
    8
    case ChangePackage.RESOURCE_CHANGE__LIST_CHANGES:
    8
    case ChangePackage.RESOURCE_CHANGE__LIST_CHANGES:
    8
    case Ecore2XMLPackage.XML_MAP__NO_NAMESPACE_PACKAGE:
    Differences
    Expression1Expression2Difference
    org.eclipse.emf.ecore.change.ChangePackageorg.eclipse.emf.mapping.ecore2xml.Ecore2XMLPackageVARIABLE_TYPE_MISMATCH
    RESOURCE_CHANGE__LIST_CHANGESXML_MAP__NO_NAMESPACE_PACKAGEVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.ecore.change.ChangePackage of variable ChangePackage does not match with type org.eclipse.emf.mapping.ecore2xml.Ecore2XMLPackage of variable Ecore2XMLPackage
    • Make classes org.eclipse.emf.ecore.change.ChangePackage and org.eclipse.emf.mapping.ecore2xml.Ecore2XMLPackage extend a common superclass
    8
    case Ecore2XMLPackage.XML_MAP__NO_NAMESPACE_PACKAGE:
    9
    getListChanges().clear();
    9
    getListChanges().clear();
    9
    setNoNamespacePackage((EPackage)null);
    Differences
    Expression1Expression2Difference
    clearsetNoNamespacePackageMETHOD_INVOCATION_NAME_MISMATCH
    getListChanges().clear()setNoNamespacePackage((EPackage)null)ARGUMENT_NUMBER_MISMATCH
    getListChanges()MISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression getListChanges().clear() is a void method call, and thus it cannot be parameterized
    Expression setNoNamespacePackage((EPackage)null) is a void method call, and thus it cannot be parameterized
    Expression getListChanges().clear() is a void method call, and thus it cannot be parameterized
    Expression setNoNamespacePackage((EPackage)null) is a void method call, and thus it cannot be parameterized
    9
    setNoNamespacePackage((EPackage)null);
    10
    return;
    10
    return;
    11
    super.eUnset(featureID);
    11
    super.eUnset(featureID);
    Precondition Violations (13)
    Row Violation
    1Type org.eclipse.emf.ecore.change.ChangePackage of variable ChangePackage does not match with type org.eclipse.emf.mapping.ecore2xml.Ecore2XMLPackage of variable Ecore2XMLPackage
    2Expression setResourceURI(RESOURCE_URI_EDEFAULT) is a void method call, and thus it cannot be parameterized
    3Expression setIDAttributeName(ID_ATTRIBUTE_NAME_EDEFAULT) is a void method call, and thus it cannot be parameterized
    4Type org.eclipse.emf.ecore.change.ChangePackage of variable ChangePackage does not match with type org.eclipse.emf.mapping.ecore2xml.Ecore2XMLPackage of variable Ecore2XMLPackage
    5Expression setResource(RESOURCE_EDEFAULT) is a void method call, and thus it cannot be parameterized
    6Expression getEcoreToXMLInfo().clear() is a void method call, and thus it cannot be parameterized
    7Expression setResource(RESOURCE_EDEFAULT) is a void method call, and thus it cannot be parameterized
    8Expression getEcoreToXMLInfo().clear() is a void method call, and thus it cannot be parameterized
    9Type org.eclipse.emf.ecore.change.ChangePackage of variable ChangePackage does not match with type org.eclipse.emf.mapping.ecore2xml.Ecore2XMLPackage of variable Ecore2XMLPackage
    10Expression getListChanges().clear() is a void method call, and thus it cannot be parameterized
    11Expression setNoNamespacePackage((EPackage)null) is a void method call, and thus it cannot be parameterized
    12Expression getListChanges().clear() is a void method call, and thus it cannot be parameterized
    13Expression setNoNamespacePackage((EPackage)null) is a void method call, and thus it cannot be parameterized