switch (featureID) { case XMLNamespacePackage.XML_NAMESPACE_DOCUMENT_ROOT__MIXED: getMixed().clear(); return; case XMLNamespacePackage.XML_NAMESPACE_DOCUMENT_ROOT__XMLNS_PREFIX_MAP: getXMLNSPrefixMap().clear(); return; case XMLNamespacePackage.XML_NAMESPACE_DOCUMENT_ROOT__XSI_SCHEMA_LOCATION: getXSISchemaLocation().clear(); return; case XMLNamespacePackage.XML_NAMESPACE_DOCUMENT_ROOT__BASE: setBase(BASE_EDEFAULT); return; case XMLNamespacePackage.XML_NAMESPACE_DOCUMENT_ROOT__ID: setId(ID_EDEFAULT); return; case XMLNamespacePackage.XML_NAMESPACE_DOCUMENT_ROOT__LANG: setLang(LANG_EDEFAULT); return; case XMLNamespacePackage.XML_NAMESPACE_DOCUMENT_ROOT__SPACE: unsetSpace(); return; } eDynamicUnset(featureID);
switch (featureID) { case XMLTypePackage.SIMPLE_ANY_TYPE__MIXED: getMixed().clear(); return; case XMLTypePackage.SIMPLE_ANY_TYPE__ANY: getAny().clear(); return; case XMLTypePackage.SIMPLE_ANY_TYPE__ANY_ATTRIBUTE: getAnyAttribute().clear(); return; case XMLTypePackage.SIMPLE_ANY_TYPE__RAW_VALUE: setRawValue(RAW_VALUE_EDEFAULT); return; case XMLTypePackage.SIMPLE_ANY_TYPE__VALUE: setValue(VALUE_EDEFAULT); return; case XMLTypePackage.SIMPLE_ANY_TYPE__INSTANCE_TYPE: setInstanceType((EDataType)null); return; } eDynamicUnset(featureID);
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xml/namespace/impl/XMLNamespaceDocumentRootImpl.java File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xml/type/impl/SimpleAnyTypeImpl.java
Method name: void eUnset(int) Method name: void eUnset(int)
Number of AST nodes: 23 Number of AST nodes: 20
1
switch (featureID)
1
switch (featureID)
2
    {
2
    {
3
      case XMLNamespacePackage.XML_NAMESPACE_DOCUMENT_ROOT__MIXED:
3
      case XMLTypePackage.SIMPLE_ANY_TYPE__MIXED:
4
        getMixed().clear();
4
        getMixed().clear();
5
        return;
5
        return;
6
      case XMLNamespacePackage.XML_NAMESPACE_DOCUMENT_ROOT__XMLNS_PREFIX_MAP:
6
      case XMLTypePackage.
7
        getXMLNSPrefixMap
7
SIMPLE_ANY_TYPE__ANY:
8
().clear();
8
        getAny().clear();
9
        return;
9
        return;
10
      case XMLNamespacePackage.XML_NAMESPACE_DOCUMENT_ROOT__XSI_SCHEMA_LOCATION:
10
      case XMLTypePackage.
11
        getXSISchemaLocation
11
SIMPLE_ANY_TYPE__ANY_ATTRIBUTE:
12
().clear();
12
        getAnyAttribute().clear();
13
        return;
13
        return;
14
      case XMLNamespacePackage.XML_NAMESPACE_DOCUMENT_ROOT__BASE:
14
      case XMLTypePackage.SIMPLE_ANY_TYPE__RAW_VALUE:
15
        setBase(BASE_EDEFAULT);
15
        set
16
        return;
17
      case XMLNamespacePackage.XML_NAMESPACE_DOCUMENT_ROOT__ID:
18
        setId(ID_EDEFAULT);
16
RawValue(RAW_VALUE_EDEFAULT);
19
        return;
17
        return;
20
      case XMLNamespacePackage.XML_NAMESPACE_DOCUMENT_ROOT__LANG:
18
      case XMLTypePackage.SIMPLE_ANY_TYPE__VALUE:
21
        setLang(LANG_EDEFAULT);
19
        setValue(VALUE_EDEFAULT);
22
        return;
20
        return;
23
      case XMLNamespacePackage.XML_NAMESPACE_DOCUMENT_ROOT__SPACE:
21
      case XMLTypePackage.SIMPLE_ANY_TYPE__INSTANCE_TYPE:
24
        unsetSpace();
22
        setInstanceType((EDataType)null);
25
        return;
23
        return;
26
    }
24
    }
27
    eDynamicUnset(featureID);
25
    eDynamicUnset(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 comparisons198
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements19
    Number of unmapped statements in the first code fragment4
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)6.8
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    switch (featureID)
    1
    switch (featureID)
    2
    case XMLNamespacePackage.XML_NAMESPACE_DOCUMENT_ROOT__MIXED:
    2
    case XMLNamespacePackage.XML_NAMESPACE_DOCUMENT_ROOT__MIXED:
    2
    case XMLTypePackage.SIMPLE_ANY_TYPE__MIXED:
    Differences
    Expression1Expression2Difference
    org.eclipse.emf.ecore.xml.namespace.XMLNamespacePackageorg.eclipse.emf.ecore.xml.type.XMLTypePackageVARIABLE_TYPE_MISMATCH
    XML_NAMESPACE_DOCUMENT_ROOT__MIXEDSIMPLE_ANY_TYPE__MIXEDVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.ecore.xml.namespace.XMLNamespacePackage of variable XMLNamespacePackage does not match with type org.eclipse.emf.ecore.xml.type.XMLTypePackage of variable XMLTypePackage
    • Make classes org.eclipse.emf.ecore.xml.namespace.XMLNamespacePackage and org.eclipse.emf.ecore.xml.type.XMLTypePackage extend a common superclass
    2
    case XMLTypePackage.SIMPLE_ANY_TYPE__MIXED:
    3
    getMixed().clear();
    3
    getMixed().clear();
    4
    return;
    4
    return;
    5
    case XMLNamespacePackage.XML_NAMESPACE_DOCUMENT_ROOT__XMLNS_PREFIX_MAP:
    5
    case XMLNamespacePackage.XML_NAMESPACE_DOCUMENT_ROOT__XMLNS_PREFIX_MAP:
    5
    case XMLTypePackage.SIMPLE_ANY_TYPE__ANY:
    Differences
    Expression1Expression2Difference
    org.eclipse.emf.ecore.xml.namespace.XMLNamespacePackageorg.eclipse.emf.ecore.xml.type.XMLTypePackageVARIABLE_TYPE_MISMATCH
    XML_NAMESPACE_DOCUMENT_ROOT__XMLNS_PREFIX_MAPSIMPLE_ANY_TYPE__ANYVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.ecore.xml.namespace.XMLNamespacePackage of variable XMLNamespacePackage does not match with type org.eclipse.emf.ecore.xml.type.XMLTypePackage of variable XMLTypePackage
    • Make classes org.eclipse.emf.ecore.xml.namespace.XMLNamespacePackage and org.eclipse.emf.ecore.xml.type.XMLTypePackage extend a common superclass
    5
    case XMLTypePackage.SIMPLE_ANY_TYPE__ANY:
    6
    getXMLNSPrefixMap().clear();
    6
    getXMLNSPrefixMap().clear();
    6
    getAny().clear();
    Differences
    Expression1Expression2Difference
    getXMLNSPrefixMapgetAnyMETHOD_INVOCATION_NAME_MISMATCH
    org.eclipse.emf.common.util.EMaporg.eclipse.emf.ecore.util.FeatureMapVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.common.util.EMap<java.lang.String,java.lang.String> of variable getXMLNSPrefixMap() does not match with type org.eclipse.emf.ecore.util.FeatureMap of variable getAny()
    • Make classes org.eclipse.emf.common.util.EMap and org.eclipse.emf.ecore.util.FeatureMap extend a common superclass
    6
    getAny().clear();
    7
    return;
    7
    return;
    8
    case XMLNamespacePackage.XML_NAMESPACE_DOCUMENT_ROOT__XSI_SCHEMA_LOCATION:
    8
    case XMLNamespacePackage.XML_NAMESPACE_DOCUMENT_ROOT__XSI_SCHEMA_LOCATION:
    8
    case XMLTypePackage.SIMPLE_ANY_TYPE__ANY_ATTRIBUTE:
    Differences
    Expression1Expression2Difference
    org.eclipse.emf.ecore.xml.namespace.XMLNamespacePackageorg.eclipse.emf.ecore.xml.type.XMLTypePackageVARIABLE_TYPE_MISMATCH
    XML_NAMESPACE_DOCUMENT_ROOT__XSI_SCHEMA_LOCATIONSIMPLE_ANY_TYPE__ANY_ATTRIBUTEVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.ecore.xml.namespace.XMLNamespacePackage of variable XMLNamespacePackage does not match with type org.eclipse.emf.ecore.xml.type.XMLTypePackage of variable XMLTypePackage
    • Make classes org.eclipse.emf.ecore.xml.namespace.XMLNamespacePackage and org.eclipse.emf.ecore.xml.type.XMLTypePackage extend a common superclass
    8
    case XMLTypePackage.SIMPLE_ANY_TYPE__ANY_ATTRIBUTE:
    9
    getXSISchemaLocation().clear();
    9
    getXSISchemaLocation().clear();
    9
    getAnyAttribute().clear();
    Differences
    Expression1Expression2Difference
    getXSISchemaLocationgetAnyAttributeMETHOD_INVOCATION_NAME_MISMATCH
    org.eclipse.emf.common.util.EMaporg.eclipse.emf.ecore.util.FeatureMapVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.common.util.EMap<java.lang.String,java.lang.String> of variable getXSISchemaLocation() does not match with type org.eclipse.emf.ecore.util.FeatureMap of variable getAnyAttribute()
    • Make classes org.eclipse.emf.common.util.EMap and org.eclipse.emf.ecore.util.FeatureMap extend a common superclass
    9
    getAnyAttribute().clear();
    10
    return;
    10
    return;
    11
    case XMLNamespacePackage.XML_NAMESPACE_DOCUMENT_ROOT__BASE:
    11
    case XMLNamespacePackage.XML_NAMESPACE_DOCUMENT_ROOT__BASE:
    11
    case XMLTypePackage.SIMPLE_ANY_TYPE__RAW_VALUE:
    Differences
    Expression1Expression2Difference
    org.eclipse.emf.ecore.xml.namespace.XMLNamespacePackageorg.eclipse.emf.ecore.xml.type.XMLTypePackageVARIABLE_TYPE_MISMATCH
    XML_NAMESPACE_DOCUMENT_ROOT__BASESIMPLE_ANY_TYPE__RAW_VALUEVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.ecore.xml.namespace.XMLNamespacePackage of variable XMLNamespacePackage does not match with type org.eclipse.emf.ecore.xml.type.XMLTypePackage of variable XMLTypePackage
    • Make classes org.eclipse.emf.ecore.xml.namespace.XMLNamespacePackage and org.eclipse.emf.ecore.xml.type.XMLTypePackage extend a common superclass
    11
    case XMLTypePackage.SIMPLE_ANY_TYPE__RAW_VALUE:
    12
    setBase(BASE_EDEFAULT);
    12
    setBase(BASE_EDEFAULT);
    12
    setRawValue(RAW_VALUE_EDEFAULT);
    Differences
    Expression1Expression2Difference
    setBasesetRawValueMETHOD_INVOCATION_NAME_MISMATCH
    BASE_EDEFAULTRAW_VALUE_EDEFAULTVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression setBase(BASE_EDEFAULT) is a void method call, and thus it cannot be parameterized
    Expression setRawValue(RAW_VALUE_EDEFAULT) is a void method call, and thus it cannot be parameterized
    12
    setRawValue(RAW_VALUE_EDEFAULT);
    13
    return;
    13
    return;
    14
    case XMLNamespacePackage.XML_NAMESPACE_DOCUMENT_ROOT__ID:
    14
    case XMLNamespacePackage.XML_NAMESPACE_DOCUMENT_ROOT__ID:
    14
    case XMLTypePackage.SIMPLE_ANY_TYPE__VALUE:
    Differences
    Expression1Expression2Difference
    org.eclipse.emf.ecore.xml.namespace.XMLNamespacePackageorg.eclipse.emf.ecore.xml.type.XMLTypePackageVARIABLE_TYPE_MISMATCH
    XML_NAMESPACE_DOCUMENT_ROOT__IDSIMPLE_ANY_TYPE__VALUEVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.ecore.xml.namespace.XMLNamespacePackage of variable XMLNamespacePackage does not match with type org.eclipse.emf.ecore.xml.type.XMLTypePackage of variable XMLTypePackage
    • Make classes org.eclipse.emf.ecore.xml.namespace.XMLNamespacePackage and org.eclipse.emf.ecore.xml.type.XMLTypePackage extend a common superclass
    14
    case XMLTypePackage.SIMPLE_ANY_TYPE__VALUE:
    15
    setId(ID_EDEFAULT);
                                                  
    16
    return;
    16
    return;
    17
    case XMLNamespacePackage.XML_NAMESPACE_DOCUMENT_ROOT__LANG:
    17
    case XMLNamespacePackage.XML_NAMESPACE_DOCUMENT_ROOT__LANG:
    17
    case XMLTypePackage.SIMPLE_ANY_TYPE__INSTANCE_TYPE:
    Differences
    Expression1Expression2Difference
    org.eclipse.emf.ecore.xml.namespace.XMLNamespacePackageorg.eclipse.emf.ecore.xml.type.XMLTypePackageVARIABLE_TYPE_MISMATCH
    XML_NAMESPACE_DOCUMENT_ROOT__LANGSIMPLE_ANY_TYPE__INSTANCE_TYPEVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.ecore.xml.namespace.XMLNamespacePackage of variable XMLNamespacePackage does not match with type org.eclipse.emf.ecore.xml.type.XMLTypePackage of variable XMLTypePackage
    • Make classes org.eclipse.emf.ecore.xml.namespace.XMLNamespacePackage and org.eclipse.emf.ecore.xml.type.XMLTypePackage extend a common superclass
    17
    case XMLTypePackage.SIMPLE_ANY_TYPE__INSTANCE_TYPE:
                                                                              
    18
    setInstanceType((EDataType)null);
    18
    setLang(LANG_EDEFAULT);
                                                          
    19
    return;
    19
    return;
    20
    case XMLNamespacePackage.XML_NAMESPACE_DOCUMENT_ROOT__SPACE:
                                                                                                                                    
    21
    unsetSpace();
    21
    unsetSpace();
    15
    setValue(VALUE_EDEFAULT);
    Differences
    Expression1Expression2Difference
    unsetSpacesetValueMETHOD_INVOCATION_NAME_MISMATCH
    unsetSpace()setValue(VALUE_EDEFAULT)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression unsetSpace() is a void method call, and thus it cannot be parameterized
    Expression setValue(VALUE_EDEFAULT) is a void method call, and thus it cannot be parameterized
    Expression unsetSpace() is a void method call, and thus it cannot be parameterized
    Expression setValue(VALUE_EDEFAULT) is a void method call, and thus it cannot be parameterized
    15
    setValue(VALUE_EDEFAULT);
    22
    return;
    22
    return;
    Preondition Violations
    Unmatched return;
                          
    23
    eDynamicUnset(featureID);
    20
    eDynamicUnset(featureID);
    Precondition Violations (15)
    Row Violation
    1Type org.eclipse.emf.ecore.xml.namespace.XMLNamespacePackage of variable XMLNamespacePackage does not match with type org.eclipse.emf.ecore.xml.type.XMLTypePackage of variable XMLTypePackage
    2Type org.eclipse.emf.ecore.xml.namespace.XMLNamespacePackage of variable XMLNamespacePackage does not match with type org.eclipse.emf.ecore.xml.type.XMLTypePackage of variable XMLTypePackage
    3Type org.eclipse.emf.common.util.EMap<java.lang.String,java.lang.String> of variable getXMLNSPrefixMap() does not match with type org.eclipse.emf.ecore.util.FeatureMap of variable getAny()
    4Type org.eclipse.emf.ecore.xml.namespace.XMLNamespacePackage of variable XMLNamespacePackage does not match with type org.eclipse.emf.ecore.xml.type.XMLTypePackage of variable XMLTypePackage
    5Type org.eclipse.emf.common.util.EMap<java.lang.String,java.lang.String> of variable getXSISchemaLocation() does not match with type org.eclipse.emf.ecore.util.FeatureMap of variable getAnyAttribute()
    6Type org.eclipse.emf.ecore.xml.namespace.XMLNamespacePackage of variable XMLNamespacePackage does not match with type org.eclipse.emf.ecore.xml.type.XMLTypePackage of variable XMLTypePackage
    7Expression setBase(BASE_EDEFAULT) is a void method call, and thus it cannot be parameterized
    8Expression setRawValue(RAW_VALUE_EDEFAULT) is a void method call, and thus it cannot be parameterized
    9Type org.eclipse.emf.ecore.xml.namespace.XMLNamespacePackage of variable XMLNamespacePackage does not match with type org.eclipse.emf.ecore.xml.type.XMLTypePackage of variable XMLTypePackage
    10Type org.eclipse.emf.ecore.xml.namespace.XMLNamespacePackage of variable XMLNamespacePackage does not match with type org.eclipse.emf.ecore.xml.type.XMLTypePackage of variable XMLTypePackage
    11Expression unsetSpace() is a void method call, and thus it cannot be parameterized
    12Expression setValue(VALUE_EDEFAULT) is a void method call, and thus it cannot be parameterized
    13Expression unsetSpace() is a void method call, and thus it cannot be parameterized
    14Expression setValue(VALUE_EDEFAULT) is a void method call, and thus it cannot be parameterized
    15Unmatched return;