EParameter p = ecoreFactory.createEParameter(); p.setEType(type); p.setName(name); owner.getEParameters().add(p);
EParameter p = ecoreFactory.createEParameter(); p.setEGenericType(type); p.setName(name); owner.getEParameters().add(p);
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/impl/EPackageImpl.java File path: /emf-2.4.1/src/org/eclipse/emf/ecore/impl/EPackageImpl.java
Method name: EParameter internalAddEParameter(EOperation, EClassifier, String) Method name: void addEParameter(EOperation, EGenericType, String, int, int, boolean, boolean)
Number of AST nodes: 4 Number of AST nodes: 4
1
EParameter p = ecoreFactory.createEParameter();
1
EParameter p = ecoreFactory.createEParameter();
2
    p.setEType(type);
2
    p.setEGenericType(type);
3
    p.setName(name);
3
    p.setName(name);
4
    owner.getEParameters().add(p);
4
    owner.getEParameters().add(p);
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.0
Clones locationClones are declared in the same class
Number of node comparisons8
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    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.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    EParameter p = ecoreFactory.createEParameter();
    1
    EParameter p = ecoreFactory.createEParameter();
    2
    p.setEType(type);
    2
    p.setEType(type);
    2
    p.setEGenericType(type);
    Differences
    Expression1Expression2Difference
    setETypesetEGenericTypeMETHOD_INVOCATION_NAME_MISMATCH
    org.eclipse.emf.ecore.EClassifierorg.eclipse.emf.ecore.EGenericTypeVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression p.setEType(type) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression p.setEGenericType(type) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression p.setEType(type) is a void method call, and thus it cannot be parameterized
    Expression p.setEGenericType(type) is a void method call, and thus it cannot be parameterized
    Type org.eclipse.emf.ecore.EClassifier of variable type does not match with type org.eclipse.emf.ecore.EGenericType of variable type
    • Make classes org.eclipse.emf.ecore.EClassifier and org.eclipse.emf.ecore.EGenericType extend a common superclass
    2
    p.setEGenericType(type);
    3
    p.setName(name);
    3
    p.setName(name);
    4
    owner.getEParameters().add(p);
    4
    owner.getEParameters().add(p);
    Precondition Violations (5)
    Row Violation
    1Expression p.setEType(type) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression p.setEGenericType(type) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression p.setEType(type) is a void method call, and thus it cannot be parameterized
    4Expression p.setEGenericType(type) is a void method call, and thus it cannot be parameterized
    5Type org.eclipse.emf.ecore.EClassifier of variable type does not match with type org.eclipse.emf.ecore.EGenericType of variable type