EObject newObject = null; if (useNewMethods) { newObject = createObject(eFactory, helper.getType(eFactory, name) , false); } else { newObject = createObjectFromFactory(eFactory, name); } newObject = validateCreateObjectFromFactory(eFactory, name, newObject, top);
EObject newObject = null; if (useNewMethods) { newObject = createObject(eFactory, helper.getType(eFactory, name), false); } else { newObject = createObjectFromFactory(eFactory, name); } newObject = validateCreateObjectFromFactory(eFactory, name, newObject, feature);
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xmi/impl/XMLHandler.java File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xmi/impl/XMLHandler.java
Method name: EObject createObjectByType(String, String, boolean) Method name: void handleFeature(String, String)
Number of AST nodes: 5 Number of AST nodes: 5
1
EObject newObject = null;
1
EObject newObject = null;
2
    if (useNewMethods)
2
        if (useNewMethods)
3
    {
3
    
4
    {
4
      newObject = createObject(eFactory, helper.getType(eFactory, name) , false);
5
          newObject = createObject(eFactory, helper.getType(eFactory, name), false);
5
     
6
        }
6
    }
7
    
7
    else
8
    else
8
    {
9
        {
9
      newObject = createObjectFromFactory(eFactory, name);
10
            newObject = createObjectFromFactory(eFactory, name);
10
    }
11
        }
11
    newObject = validateCreateObjectFromFactory(eFactory, name, newObject, top);
12
        newObject = validateCreateObjectFromFactory(eFactory, name, newObject, feature);
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 declared in the same class
Number of node comparisons13
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)231.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    13
    EObject newObject = null;
    43
    EObject newObject = null;
    14
    if (useNewMethods)
    44
    if (useNewMethods)
    15
    newObject = createObject(eFactory, helper.getType(eFactory, name), false);
    45
    newObject = createObject(eFactory, helper.getType(eFactory, name), false);
    else
    else
    16
    newObject = createObjectFromFactory(eFactory, name);
    46
    newObject = createObjectFromFactory(eFactory, name);
    17
    newObject = validateCreateObjectFromFactory(eFactory, name, newObject, top);
    17
    newObject = validateCreateObjectFromFactory(eFactory, name, newObject, top);
    47
    newObject = validateCreateObjectFromFactory(eFactory, name, newObject, feature);
    Differences
    Expression1Expression2Difference
    topfeatureVARIABLE_NAME_MISMATCH
    booleanorg.eclipse.emf.ecore.EStructuralFeatureVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type boolean of variable top does not match with type org.eclipse.emf.ecore.EStructuralFeature of variable feature
    47
    newObject = validateCreateObjectFromFactory(eFactory, name, newObject, feature);
    Precondition Violations (1)
    Row Violation
    1Type boolean of variable top does not match with type org.eclipse.emf.ecore.EStructuralFeature of variable feature