switch (featureID) { case Ecore2XMLPackage.XML_INFO__NAME: setName((String)newValue); return; case Ecore2XMLPackage.XML_INFO__TARGET_NAMESPACE: setTargetNamespace((String)newValue); return; case Ecore2XMLPackage.XML_INFO__XML_REPRESENTATION: setXMLRepresentation(((Integer)newValue).intValue()); return; } super.eSet(featureID, newValue);
switch (featureID) { case MappingPackage.MAPPING_ROOT__OUTPUT_READ_ONLY: setOutputReadOnly(((Boolean)newValue).booleanValue()); return; case MappingPackage.MAPPING_ROOT__TOP_TO_BOTTOM: setTopToBottom(((Boolean)newValue).booleanValue()); return; case MappingPackage.MAPPING_ROOT__COMMAND_STACK: setCommandStack((String)newValue); return; } super.eSet(featureID, newValue);
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/mapping/ecore2xml/impl/XMLInfoImpl.java File path: /emf-2.4.1/src/org/eclipse/emf/mapping/impl/MappingRootImpl.java
Method name: void eSet(int, Object) Method name: void eSet(int, Object)
Number of AST nodes: 11 Number of AST nodes: 11
1
switch (featureID)
1
switch (featureID)
2
    {
2
    {
3
      case Ecore2XMLPackage.XML_INFO__NAME:
3
      case 
4
        setName((String)newValue
4
MappingPackage.MAPPING_ROOT__OUTPUT_READ_ONLY:
5
);
5
        setOutputReadOnly(((Boolean)newValue).booleanValue());
6
        return;
6
        return;
7
      case Ecore2XMLPackage.XML_INFO__TARGET_NAMESPACE:
7
      case 
8
        setTargetNamespace((String)newValue
8
MappingPackage.MAPPING_ROOT__TOP_TO_BOTTOM:
9
);
9
        setTopToBottom(((Boolean)newValue).booleanValue());
10
        return;
10
        return;
11
      case Ecore2XMLPackage.XML_INFO__XML_REPRESENTATION:
11
      case 
12
        setXMLRepresentation(((Integer)newValue).intValue()
12
MappingPackage.MAPPING_ROOT__COMMAND_STACK:
13
);
13
        setCommandStack((String)newValue);
14
        return;
14
        return;
15
    }
15
    }
16
    super.eSet(featureID, newValue);
16
    super.eSet(featureID, newValue);
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 Ecore2XMLPackage.XML_INFO__NAME:
    2
    case Ecore2XMLPackage.XML_INFO__NAME:
    8
    case MappingPackage.MAPPING_ROOT__COMMAND_STACK:
    Differences
    Expression1Expression2Difference
    org.eclipse.emf.mapping.ecore2xml.Ecore2XMLPackageorg.eclipse.emf.mapping.MappingPackageVARIABLE_TYPE_MISMATCH
    XML_INFO__NAMEMAPPING_ROOT__COMMAND_STACKVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.mapping.ecore2xml.Ecore2XMLPackage of variable Ecore2XMLPackage does not match with type org.eclipse.emf.mapping.MappingPackage of variable MappingPackage
    • Make classes org.eclipse.emf.mapping.ecore2xml.Ecore2XMLPackage and org.eclipse.emf.mapping.MappingPackage extend a common superclass
    8
    case MappingPackage.MAPPING_ROOT__COMMAND_STACK:
    3
    setName((String)newValue);
    3
    setName((String)newValue);
    9
    setCommandStack((String)newValue);
    Differences
    Expression1Expression2Difference
    setNamesetCommandStackMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression setName((String)newValue) is a void method call, and thus it cannot be parameterized
    Expression setCommandStack((String)newValue) is a void method call, and thus it cannot be parameterized
    9
    setCommandStack((String)newValue);
    4
    return;
    10
    return;
    5
    case Ecore2XMLPackage.XML_INFO__TARGET_NAMESPACE:
    5
    case Ecore2XMLPackage.XML_INFO__TARGET_NAMESPACE:
    5
    case MappingPackage.MAPPING_ROOT__TOP_TO_BOTTOM:
    Differences
    Expression1Expression2Difference
    org.eclipse.emf.mapping.ecore2xml.Ecore2XMLPackageorg.eclipse.emf.mapping.MappingPackageVARIABLE_TYPE_MISMATCH
    XML_INFO__TARGET_NAMESPACEMAPPING_ROOT__TOP_TO_BOTTOMVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.mapping.ecore2xml.Ecore2XMLPackage of variable Ecore2XMLPackage does not match with type org.eclipse.emf.mapping.MappingPackage of variable MappingPackage
    • Make classes org.eclipse.emf.mapping.ecore2xml.Ecore2XMLPackage and org.eclipse.emf.mapping.MappingPackage extend a common superclass
    5
    case MappingPackage.MAPPING_ROOT__TOP_TO_BOTTOM:
    6
    setTargetNamespace((String)newValue);
                                                                                    
    7
    return;
    7
    return;
    8
    case Ecore2XMLPackage.XML_INFO__XML_REPRESENTATION:
    8
    case Ecore2XMLPackage.XML_INFO__XML_REPRESENTATION:
    2
    case MappingPackage.MAPPING_ROOT__OUTPUT_READ_ONLY:
    Differences
    Expression1Expression2Difference
    org.eclipse.emf.mapping.ecore2xml.Ecore2XMLPackageorg.eclipse.emf.mapping.MappingPackageVARIABLE_TYPE_MISMATCH
    XML_INFO__XML_REPRESENTATIONMAPPING_ROOT__OUTPUT_READ_ONLYVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.mapping.ecore2xml.Ecore2XMLPackage of variable Ecore2XMLPackage does not match with type org.eclipse.emf.mapping.MappingPackage of variable MappingPackage
    • Make classes org.eclipse.emf.mapping.ecore2xml.Ecore2XMLPackage and org.eclipse.emf.mapping.MappingPackage extend a common superclass
    2
    case MappingPackage.MAPPING_ROOT__OUTPUT_READ_ONLY:
    9
    setXMLRepresentation(((Integer)newValue).intValue());
    9
    setXMLRepresentation(((Integer)newValue).intValue());
    3
    setOutputReadOnly(((Boolean)newValue).booleanValue());
    Differences
    Expression1Expression2Difference
    setXMLRepresentationsetOutputReadOnlyMETHOD_INVOCATION_NAME_MISMATCH
    intValuebooleanValueMETHOD_INVOCATION_NAME_MISMATCH
    intbooleanVARIABLE_TYPE_MISMATCH
    java.lang.Integerjava.lang.BooleanVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression setXMLRepresentation(((Integer)newValue).intValue()) is a void method call, and thus it cannot be parameterized
    Expression setOutputReadOnly(((Boolean)newValue).booleanValue()) is a void method call, and thus it cannot be parameterized
    Type int of variable ((Integer)newValue).intValue() does not match with type boolean of variable ((Boolean)newValue).booleanValue()
    Type java.lang.Integer of variable (Integer)newValue does not match with type java.lang.Boolean of variable (Boolean)newValue
    • Make classes java.lang.Integer and java.lang.Boolean extend a common superclass
    3
    setOutputReadOnly(((Boolean)newValue).booleanValue());
    10
    return;
    4
    return;
                                                                                                                
    6
    setTopToBottom(((Boolean)newValue).booleanValue());
    11
    super.eSet(featureID, newValue);
    11
    super.eSet(featureID, newValue);
    Precondition Violations (9)
    Row Violation
    1Type org.eclipse.emf.mapping.ecore2xml.Ecore2XMLPackage of variable Ecore2XMLPackage does not match with type org.eclipse.emf.mapping.MappingPackage of variable MappingPackage
    2Expression setName((String)newValue) is a void method call, and thus it cannot be parameterized
    3Expression setCommandStack((String)newValue) is a void method call, and thus it cannot be parameterized
    4Type org.eclipse.emf.mapping.ecore2xml.Ecore2XMLPackage of variable Ecore2XMLPackage does not match with type org.eclipse.emf.mapping.MappingPackage of variable MappingPackage
    5Type org.eclipse.emf.mapping.ecore2xml.Ecore2XMLPackage of variable Ecore2XMLPackage does not match with type org.eclipse.emf.mapping.MappingPackage of variable MappingPackage
    6Expression setXMLRepresentation(((Integer)newValue).intValue()) is a void method call, and thus it cannot be parameterized
    7Expression setOutputReadOnly(((Boolean)newValue).booleanValue()) is a void method call, and thus it cannot be parameterized
    8Type int of variable ((Integer)newValue).intValue() does not match with type boolean of variable ((Boolean)newValue).booleanValue()
    9Type java.lang.Integer of variable (Integer)newValue does not match with type java.lang.Boolean of variable (Boolean)newValue