Object wrapper = childrenMap.get(object); if (wrapper != null) { i.set(wrapper); }
InternalEObject value = values.get(i); if (value != null) { saveElement(value, f); }
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/edit/provider/DelegatingWrapperItemProvider.java File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xmi/impl/XMLSaveImpl.java
Method name: Collection getAffectedObjects() Method name: void saveContainedMany(EObject, EStructuralFeature)
Number of AST nodes: 3 Number of AST nodes: 3
1
Object wrapper = childrenMap.get(object);
2
    
1
InternalEObject value = values.get(i);
3
      if (wrapper != null)
2
      if (value != null)
4
          {
3
      {
5
            i.set(wrapper);
4
        
6
    
5
saveElement(value, f);
7
      }
6
      }
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
Number of node comparisons7
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)8412.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                                                                  
    4
    InternalEObject value = values.get(i);
    Preondition Violations
    Unmatched statement InternalEObject value=values.get(i); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4
    InternalEObject value = values.get(i);
    8
    Object wrapper = childrenMap.get(object);
    8
    Object wrapper = childrenMap.get(object);
    Preondition Violations
    Unmatched statement Object wrapper=childrenMap.get(object); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                        
    9
    if (wrapper != null)
    9
    if (wrapper != null)
    5
    if (value != null)
    Differences
    Expression1Expression2Difference
    wrappervalueVARIABLE_NAME_MISMATCH
    java.lang.Objectorg.eclipse.emf.ecore.InternalEObjectVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.lang.Object of variable wrapper does not match with type org.eclipse.emf.ecore.InternalEObject of variable value
    • Make classes java.lang.Object and org.eclipse.emf.ecore.InternalEObject extend a common superclass
    5
    if (value != null)
    10
    i.set(wrapper);
    10
    i.set(wrapper);
    6
    saveElement(value, f);
    Differences
    Expression1Expression2Difference
    setsaveElementMETHOD_INVOCATION_NAME_MISMATCH
    i.set(wrapper)saveElement(value,f)ARGUMENT_NUMBER_MISMATCH
    iMISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression i.set(wrapper) is a void method call, and thus it cannot be parameterized
    Expression saveElement(value,f) is a void method call, and thus it cannot be parameterized
    Expression i.set(wrapper) is a void method call, and thus it cannot be parameterized
    Expression saveElement(value,f) is a void method call, and thus it cannot be parameterized
    6
    saveElement(value, f);
    Precondition Violations (7)
    Row Violation
    1Unmatched statement InternalEObject value=values.get(i); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement Object wrapper=childrenMap.get(object); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Type java.lang.Object of variable wrapper does not match with type org.eclipse.emf.ecore.InternalEObject of variable value
    4Expression i.set(wrapper) is a void method call, and thus it cannot be parameterized
    5Expression saveElement(value,f) is a void method call, and thus it cannot be parameterized
    6Expression i.set(wrapper) is a void method call, and thus it cannot be parameterized
    7Expression saveElement(value,f) is a void method call, and thus it cannot be parameterized