@SuppressWarnings("unchecked") InternalEList<? extends EObject> values = (InternalEList<? extends EObject>)helper.getValue(o, f); int size = values.size(); for (int i = 0; i < size; i++) { saveHref(values.basicGet(i), f); }
@SuppressWarnings("unchecked") InternalEList<? extends EObject> values = (InternalEList<? extends EObject>)helper.getValue(o, f); int size = values.size(); for (int i = 0; i < size; i++) { saveElementReference(values.basicGet(i), f); }
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xmi/impl/XMLSaveImpl.java File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xmi/impl/XMLSaveImpl.java
Method name: void saveHRefMany(EObject, EStructuralFeature) Method name: void saveElementReferenceMany(EObject, EStructuralFeature)
Number of AST nodes: 4 Number of AST nodes: 4
1
@SuppressWarnings("unchecked") InternalEList<? extends EObject> values = (InternalEList<? extends EObject>)helper.getValue(o, f);
1
@SuppressWarnings("unchecked") InternalEList<? extends EObject> values = (InternalEList<? extends EObject>)helper.getValue(o, f);
2
    int size = values.size();
2
    int size = values.size();
3
    for (int i = 0; i < size; i++)
3
    for (int i = 0; i < size; i++)
4
    {
4
    {
5
      saveHref(values.basicGet(i), f);
5
      saveElementReference(values.basicGet(i), f);
6
    }
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 declared in the same class
Number of node comparisons8
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)6801.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                                                                                                                                                                                                                                                      
    1
    @SuppressWarnings("unchecked") InternalEList<?extendsEObject> values = (InternalEList<?extendsEObject>)helper.getValue(o, f);
    1
    @SuppressWarnings("unchecked") InternalEList<?extendsEObject> values = (InternalEList<?extendsEObject>)helper.getValue(o, f);
                                                                                                                                                                                                                                                                      
    2
    int size = values.size();
    2
    int size = values.size();
    2
    int size = values.size();
    Differences
    Expression1Expression2Difference
    org.eclipse.emf.ecore.util.InternalEList<>org.eclipse.emf.ecore.util.InternalEList<>VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.ecore.util.InternalEList<> of variable values does not match with type org.eclipse.emf.ecore.util.InternalEList<> of variable values
    • Make classes org.eclipse.emf.ecore.util.InternalEList<> and org.eclipse.emf.ecore.util.InternalEList<> extend a common superclass
    2
    int size = values.size();
    3
    for (int i = 0; i < size; i++)
    3
    for (int i = 0; i < size; i++)
    4
    saveHref(values.basicGet(i), f);
    4
    saveHref(values.basicGet(i), f);
    4
    saveElementReference(values.basicGet(i), f);
    Differences
    Expression1Expression2Difference
    saveHrefsaveElementReferenceMETHOD_INVOCATION_NAME_MISMATCH
    VARIABLE_TYPE_MISMATCH
    org.eclipse.emf.ecore.util.InternalEList<>org.eclipse.emf.ecore.util.InternalEList<>VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression saveHref(values.basicGet(i),f) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression saveElementReference(values.basicGet(i),f) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression saveHref(values.basicGet(i),f) is a void method call, and thus it cannot be parameterized
    Expression saveElementReference(values.basicGet(i),f) is a void method call, and thus it cannot be parameterized
    Expression values.basicGet(i) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression values.basicGet(i) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type of variable values.basicGet(i) does not match with type of variable values.basicGet(i)
    • Make classes and extend a common superclass
    Type org.eclipse.emf.ecore.util.InternalEList<> of variable values does not match with type org.eclipse.emf.ecore.util.InternalEList<> of variable values
    • Make classes org.eclipse.emf.ecore.util.InternalEList<> and org.eclipse.emf.ecore.util.InternalEList<> extend a common superclass
    4
    saveElementReference(values.basicGet(i), f);
    Precondition Violations (9)
    Row Violation
    1Type org.eclipse.emf.ecore.util.InternalEList<> of variable values does not match with type org.eclipse.emf.ecore.util.InternalEList<> of variable values
    2Expression saveHref(values.basicGet(i),f) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression saveElementReference(values.basicGet(i),f) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression saveHref(values.basicGet(i),f) is a void method call, and thus it cannot be parameterized
    5Expression saveElementReference(values.basicGet(i),f) is a void method call, and thus it cannot be parameterized
    6Expression values.basicGet(i) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression values.basicGet(i) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Type of variable values.basicGet(i) does not match with type of variable values.basicGet(i)
    9Type org.eclipse.emf.ecore.util.InternalEList<> of variable values does not match with type org.eclipse.emf.ecore.util.InternalEList<> of variable values