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 MappingPackage.MAPPING_ROOT__OUTPUT_READ_ONLY: setOutputReadOnly(OUTPUT_READ_ONLY_EDEFAULT); return; case MappingPackage.MAPPING_ROOT__TOP_TO_BOTTOM: setTopToBottom(TOP_TO_BOTTOM_EDEFAULT); return; case MappingPackage.MAPPING_ROOT__COMMAND_STACK: setCommandStack(COMMAND_STACK_EDEFAULT); 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/impl/MappingRootImpl.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 MappingPackage.
4
        setResourceURI(RESOURCE_URI
4
MAPPING_ROOT__OUTPUT_READ_ONLY:
5
_EDEFAULT);
5
        setOutputReadOnly(OUTPUT_READ_ONLY_EDEFAULT);
6
        return;
6
        return;
7
      case ChangePackage.RESOURCE_CHANGE__RESOURCE:
7
      case MappingPackage.
8
        setResource(RESOURCE
8
MAPPING_ROOT__TOP_TO_BOTTOM:
9
_EDEFAULT);
9
        setTopToBottom(TOP_TO_BOTTOM_EDEFAULT);
10
        return;
10
        return;
11
      case ChangePackage.RESOURCE_CHANGE__LIST_CHANGES:
11
      case MappingPackage.MAPPING_ROOT__COMMAND_STACK:
12
        getListChanges().clear();
12
        setCommandStack(COMMAND_STACK_EDEFAULT);
13
        return;
13
        return;
14
    }
14
    }
15
    super.eUnset(featureID);
15
    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 statements10
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)2.5
    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:
    8
    case MappingPackage.MAPPING_ROOT__COMMAND_STACK:
    Differences
    Expression1Expression2Difference
    org.eclipse.emf.ecore.change.ChangePackageorg.eclipse.emf.mapping.MappingPackageVARIABLE_TYPE_MISMATCH
    RESOURCE_CHANGE__RESOURCE_URIMAPPING_ROOT__COMMAND_STACKVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.ecore.change.ChangePackage of variable ChangePackage does not match with type org.eclipse.emf.mapping.MappingPackage of variable MappingPackage
    • Make classes org.eclipse.emf.ecore.change.ChangePackage and org.eclipse.emf.mapping.MappingPackage extend a common superclass
    8
    case MappingPackage.MAPPING_ROOT__COMMAND_STACK:
    3
    setResourceURI(RESOURCE_URI_EDEFAULT);
    3
    setResourceURI(RESOURCE_URI_EDEFAULT);
    9
    setCommandStack(COMMAND_STACK_EDEFAULT);
    Differences
    Expression1Expression2Difference
    setResourceURIsetCommandStackMETHOD_INVOCATION_NAME_MISMATCH
    RESOURCE_URI_EDEFAULTCOMMAND_STACK_EDEFAULTVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression setResourceURI(RESOURCE_URI_EDEFAULT) is a void method call, and thus it cannot be parameterized
    Expression setCommandStack(COMMAND_STACK_EDEFAULT) is a void method call, and thus it cannot be parameterized
    9
    setCommandStack(COMMAND_STACK_EDEFAULT);
    4
    return;
    10
    return;
    5
    case ChangePackage.RESOURCE_CHANGE__RESOURCE:
    5
    case ChangePackage.RESOURCE_CHANGE__RESOURCE:
    5
    case MappingPackage.MAPPING_ROOT__TOP_TO_BOTTOM:
    Differences
    Expression1Expression2Difference
    org.eclipse.emf.ecore.change.ChangePackageorg.eclipse.emf.mapping.MappingPackageVARIABLE_TYPE_MISMATCH
    RESOURCE_CHANGE__RESOURCEMAPPING_ROOT__TOP_TO_BOTTOMVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.ecore.change.ChangePackage of variable ChangePackage does not match with type org.eclipse.emf.mapping.MappingPackage of variable MappingPackage
    • Make classes org.eclipse.emf.ecore.change.ChangePackage and org.eclipse.emf.mapping.MappingPackage extend a common superclass
    5
    case MappingPackage.MAPPING_ROOT__TOP_TO_BOTTOM:
    6
    setResource(RESOURCE_EDEFAULT);
                                                                        
    7
    return;
    7
    return;
    8
    case ChangePackage.RESOURCE_CHANGE__LIST_CHANGES:
    8
    case ChangePackage.RESOURCE_CHANGE__LIST_CHANGES:
    2
    case MappingPackage.MAPPING_ROOT__OUTPUT_READ_ONLY:
    Differences
    Expression1Expression2Difference
    org.eclipse.emf.ecore.change.ChangePackageorg.eclipse.emf.mapping.MappingPackageVARIABLE_TYPE_MISMATCH
    RESOURCE_CHANGE__LIST_CHANGESMAPPING_ROOT__OUTPUT_READ_ONLYVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.ecore.change.ChangePackage of variable ChangePackage does not match with type org.eclipse.emf.mapping.MappingPackage of variable MappingPackage
    • Make classes org.eclipse.emf.ecore.change.ChangePackage and org.eclipse.emf.mapping.MappingPackage extend a common superclass
    2
    case MappingPackage.MAPPING_ROOT__OUTPUT_READ_ONLY:
    9
    getListChanges().clear();
    9
    getListChanges().clear();
    3
    setOutputReadOnly(OUTPUT_READ_ONLY_EDEFAULT);
    Differences
    Expression1Expression2Difference
    clearsetOutputReadOnlyMETHOD_INVOCATION_NAME_MISMATCH
    getListChanges().clear()setOutputReadOnly(OUTPUT_READ_ONLY_EDEFAULT)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 setOutputReadOnly(OUTPUT_READ_ONLY_EDEFAULT) 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 setOutputReadOnly(OUTPUT_READ_ONLY_EDEFAULT) is a void method call, and thus it cannot be parameterized
    3
    setOutputReadOnly(OUTPUT_READ_ONLY_EDEFAULT);
    10
    return;
    4
    return;
                                                                                        
    6
    setTopToBottom(TOP_TO_BOTTOM_EDEFAULT);
    11
    super.eUnset(featureID);
    11
    super.eUnset(featureID);
    Precondition Violations (9)
    Row Violation
    1Type org.eclipse.emf.ecore.change.ChangePackage of variable ChangePackage does not match with type org.eclipse.emf.mapping.MappingPackage of variable MappingPackage
    2Expression setResourceURI(RESOURCE_URI_EDEFAULT) is a void method call, and thus it cannot be parameterized
    3Expression setCommandStack(COMMAND_STACK_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.MappingPackage of variable MappingPackage
    5Type org.eclipse.emf.ecore.change.ChangePackage of variable ChangePackage does not match with type org.eclipse.emf.mapping.MappingPackage of variable MappingPackage
    6Expression getListChanges().clear() is a void method call, and thus it cannot be parameterized
    7Expression setOutputReadOnly(OUTPUT_READ_ONLY_EDEFAULT) is a void method call, and thus it cannot be parameterized
    8Expression getListChanges().clear() is a void method call, and thus it cannot be parameterized
    9Expression setOutputReadOnly(OUTPUT_READ_ONLY_EDEFAULT) is a void method call, and thus it cannot be parameterized