ChangeKind result = ChangeKind.get(initialValue); if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); return result;
SpaceType result = SpaceType.get(initialValue); if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); return result;
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/change/impl/ChangeFactoryImpl.java File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xml/namespace/impl/XMLNamespaceFactoryImpl.java
Method name: ChangeKind createChangeKindFromString(EDataType, String) Method name: SpaceType createSpaceTypeFromString(EDataType, String)
Number of AST nodes: 4 Number of AST nodes: 4
1
ChangeKind result = ChangeKind.get(initialValue);
1
SpaceType result = SpaceType.get(initialValue);
2
    if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
2
    if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
3
    return result;
3
    return result;
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 comparisons8
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)0.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                                                                                    
    1
    SpaceType result = SpaceType.get(initialValue);
    1
    ChangeKind result = ChangeKind.get(initialValue);
                                                                                                        
    2
    if (result == null)
    2
    if (result == null)
    2
    if (result == null)
    Differences
    Expression1Expression2Difference
    org.eclipse.emf.ecore.change.ChangeKindorg.eclipse.emf.ecore.xml.namespace.SpaceTypeVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.ecore.change.ChangeKind of variable result does not match with type org.eclipse.emf.ecore.xml.namespace.SpaceType of variable result
    • Make classes org.eclipse.emf.ecore.change.ChangeKind and org.eclipse.emf.ecore.xml.namespace.SpaceType extend a common superclass
    2
    if (result == null)
    3
    throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
    3
    throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
                                      
    4
    return result;
    Preondition Violations
    Unmatched return result;
    4
    return result;
    4
    return result;
    4
    return result;
    Preondition Violations
    Unmatched return result;
                                      
    Precondition Violations (3)
    Row Violation
    1Type org.eclipse.emf.ecore.change.ChangeKind of variable result does not match with type org.eclipse.emf.ecore.xml.namespace.SpaceType of variable result
    2Unmatched return result;
    3Unmatched return result;