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);
switch (featureID) { case TreePackage.TREE_NODE__PARENT: setParent((TreeNode)null); return; case TreePackage.TREE_NODE__CHILDREN: getChildren().clear(); return; case TreePackage.TREE_NODE__DATA: setData((EObject)null); return; } super.eUnset(featureID);
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/mapping/impl/MappingRootImpl.java File path: /emf-2.4.1/src/org/eclipse/emf/edit/tree/impl/TreeNodeImpl.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 MappingPackage.MAPPING_ROOT__OUTPUT_READ_ONLY:
3
      case TreePackage.
4
        setOutputReadOnly(OUTPUT_READ_ONLY_EDEFAULT
4
TREE_NODE__PARENT:
5
);
5
        setParent((TreeNode)null);
6
        return;
6
        return;
7
      case MappingPackage.MAPPING_ROOT__TOP_TO_BOTTOM:
7
      case TreePackage.TREE_NODE__CHILDREN:
8
        setTopToBottom(TOP_TO_BOTTOM_EDEFAULT);
8
        getChildren().clear();
9
        return;
9
        return;
10
      case MappingPackage.MAPPING_ROOT__COMMAND_STACK:
10
      case TreePackage.
11
        setCommandStack(COMMAND_STACK_EDEFAULT
11
TREE_NODE__DATA:
12
);
12
        setData((EObject)null);
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 comparisons57
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements9
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)2.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    switch (featureID)
    1
    switch (featureID)
    2
    case MappingPackage.MAPPING_ROOT__OUTPUT_READ_ONLY:
    2
    case MappingPackage.MAPPING_ROOT__OUTPUT_READ_ONLY:
    5
    case TreePackage.TREE_NODE__CHILDREN:
    Differences
    Expression1Expression2Difference
    org.eclipse.emf.mapping.MappingPackageorg.eclipse.emf.edit.tree.TreePackageVARIABLE_TYPE_MISMATCH
    MAPPING_ROOT__OUTPUT_READ_ONLYTREE_NODE__CHILDRENVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.mapping.MappingPackage of variable MappingPackage does not match with type org.eclipse.emf.edit.tree.TreePackage of variable TreePackage
    • Make classes org.eclipse.emf.mapping.MappingPackage and org.eclipse.emf.edit.tree.TreePackage extend a common superclass
    5
    case TreePackage.TREE_NODE__CHILDREN:
    3
    setOutputReadOnly(OUTPUT_READ_ONLY_EDEFAULT);
    3
    setOutputReadOnly(OUTPUT_READ_ONLY_EDEFAULT);
    6
    getChildren().clear();
    Differences
    Expression1Expression2Difference
    setOutputReadOnlyclearMETHOD_INVOCATION_NAME_MISMATCH
    setOutputReadOnly(OUTPUT_READ_ONLY_EDEFAULT)getChildren().clear()ARGUMENT_NUMBER_MISMATCH
    getChildren()MISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression setOutputReadOnly(OUTPUT_READ_ONLY_EDEFAULT) is a void method call, and thus it cannot be parameterized
    Expression getChildren().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 getChildren().clear() is a void method call, and thus it cannot be parameterized
    6
    getChildren().clear();
    4
    return;
    7
    return;
    5
    case MappingPackage.MAPPING_ROOT__TOP_TO_BOTTOM:
    5
    case MappingPackage.MAPPING_ROOT__TOP_TO_BOTTOM:
    2
    case TreePackage.TREE_NODE__PARENT:
    Differences
    Expression1Expression2Difference
    org.eclipse.emf.mapping.MappingPackageorg.eclipse.emf.edit.tree.TreePackageVARIABLE_TYPE_MISMATCH
    MAPPING_ROOT__TOP_TO_BOTTOMTREE_NODE__PARENTVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.mapping.MappingPackage of variable MappingPackage does not match with type org.eclipse.emf.edit.tree.TreePackage of variable TreePackage
    • Make classes org.eclipse.emf.mapping.MappingPackage and org.eclipse.emf.edit.tree.TreePackage extend a common superclass
    2
    case TreePackage.TREE_NODE__PARENT:
                                                              
    3
    setParent((TreeNode)null);
    6
    setTopToBottom(TOP_TO_BOTTOM_EDEFAULT);
                                                                                        
    7
    return;
    4
    return;
    8
    case MappingPackage.MAPPING_ROOT__COMMAND_STACK:
    8
    case MappingPackage.MAPPING_ROOT__COMMAND_STACK:
    8
    case TreePackage.TREE_NODE__DATA:
    Differences
    Expression1Expression2Difference
    org.eclipse.emf.mapping.MappingPackageorg.eclipse.emf.edit.tree.TreePackageVARIABLE_TYPE_MISMATCH
    MAPPING_ROOT__COMMAND_STACKTREE_NODE__DATAVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.mapping.MappingPackage of variable MappingPackage does not match with type org.eclipse.emf.edit.tree.TreePackage of variable TreePackage
    • Make classes org.eclipse.emf.mapping.MappingPackage and org.eclipse.emf.edit.tree.TreePackage extend a common superclass
    8
    case TreePackage.TREE_NODE__DATA:
                                                        
    9
    setData((EObject)null);
    9
    setCommandStack(COMMAND_STACK_EDEFAULT);
                                                                                          
    10
    return;
    10
    return;
    11
    super.eUnset(featureID);
    11
    super.eUnset(featureID);
    Precondition Violations (7)
    Row Violation
    1Type org.eclipse.emf.mapping.MappingPackage of variable MappingPackage does not match with type org.eclipse.emf.edit.tree.TreePackage of variable TreePackage
    2Expression setOutputReadOnly(OUTPUT_READ_ONLY_EDEFAULT) is a void method call, and thus it cannot be parameterized
    3Expression getChildren().clear() is a void method call, and thus it cannot be parameterized
    4Expression setOutputReadOnly(OUTPUT_READ_ONLY_EDEFAULT) is a void method call, and thus it cannot be parameterized
    5Expression getChildren().clear() is a void method call, and thus it cannot be parameterized
    6Type org.eclipse.emf.mapping.MappingPackage of variable MappingPackage does not match with type org.eclipse.emf.edit.tree.TreePackage of variable TreePackage
    7Type org.eclipse.emf.mapping.MappingPackage of variable MappingPackage does not match with type org.eclipse.emf.edit.tree.TreePackage of variable TreePackage