if (!dataClass.isInstance(object)) { throw new ClassCastException("The value of type '" + object.getClass() + "' must be of type '" + dataClass + "'"); }
if (!eDataType.isInstance(object)) { throw new ClassCastException("The value of type '" + object.getClass() + "' must be of type '" + eDataType + "'"); }
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/impl/EStructuralFeatureImpl.java File path: /emf-2.4.1/src/org/eclipse/emf/ecore/impl/EStructuralFeatureImpl.java
Method name: void validate(Object) Method name: void validate(Object)
Number of AST nodes: 2 Number of AST nodes: 2
1
if (!dataClass.isInstance(object))
1
if (!eDataType.isInstance(object))
2
      {
2
      {
3
        throw new ClassCastException("The value of type '" + object.getClass() + "' must be of type '" + dataClass + "'");
3
        throw new ClassCastException("The value of type '" + object.getClass() + "' must be of type '" + eDataType + "'");
4
      }
4
      }
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.2
Clones locationClones are in the same java file
Number of node comparisons4
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (!dataClass.isInstance(object))
    1
    if (!dataClass.isInstance(object))
    1
    if (!eDataType.isInstance(object))
    Differences
    Expression1Expression2Difference
    dataClasseDataTypeVARIABLE_NAME_MISMATCH
    java.lang.Class<>org.eclipse.emf.ecore.EDataTypeVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.lang.Class<> of variable dataClass does not match with type org.eclipse.emf.ecore.EDataType of variable eDataType
    • Make classes java.lang.Class<> and org.eclipse.emf.ecore.EDataType extend a common superclass
    1
    if (!eDataType.isInstance(object))
    2
    throw new ClassCastException("The value of type '" + object.getClass() + "' must be of type '" + dataClass + "'");
    2
    throw new ClassCastException("The value of type '" + object.getClass() + "' must be of type '" + dataClass + "'");
    2
    throw new ClassCastException("The value of type '" + object.getClass() + "' must be of type '" + eDataType + "'");
    Differences
    Expression1Expression2Difference
    dataClasseDataTypeVARIABLE_NAME_MISMATCH
    java.lang.Class<>org.eclipse.emf.ecore.EDataTypeVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.lang.Class<> of variable dataClass does not match with type org.eclipse.emf.ecore.EDataType of variable eDataType
    • Make classes java.lang.Class<> and org.eclipse.emf.ecore.EDataType extend a common superclass
    2
    throw new ClassCastException("The value of type '" + object.getClass() + "' must be of type '" + eDataType + "'");
    Precondition Violations (2)
    Row Violation
    1Type java.lang.Class<> of variable dataClass does not match with type org.eclipse.emf.ecore.EDataType of variable eDataType
    2Type java.lang.Class<> of variable dataClass does not match with type org.eclipse.emf.ecore.EDataType of variable eDataType