s.setName(name); ((EStructuralFeatureImpl)s).setContainerClass(containerClass); s.setTransient(isTransient); s.setVolatile(isVolatile); s.setChangeable(isChangeable); s.setUnsettable(isUnsettable); s.setUnique(isUnique); s.setDerived(isDerived); s.setOrdered(isOrdered); s.setLowerBound(lowerBound); s.setUpperBound(upperBound); s.setEGenericType(type); if (defaultValue != null) { s.setDefaultValueLiteral(defaultValue); }
s.setName(name); ((EStructuralFeatureImpl)s).setContainerClass(containerClass); s.setTransient(isTransient); s.setVolatile(isVolatile); s.setChangeable(isChangeable); s.setUnsettable(isUnsettable); s.setUnique(isUnique); s.setDerived(isDerived); s.setOrdered(isOrdered); s.setLowerBound(lowerBound); s.setUpperBound(upperBound); s.setEType(type); if (defaultValue != null) { s.setDefaultValueLiteral(defaultValue); }
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: void initEStructuralFeature(EStructuralFeature, EGenericType, String, String, int, int, Class, boolean, boolean, boolean, boolean, boolean, boolean, boolean) Method name: void initEStructuralFeature(EStructuralFeature, EClassifier, String, String, int, int, Class, boolean, boolean, boolean, boolean, boolean, boolean, boolean)
Number of AST nodes: 14 Number of AST nodes: 14
1
s.setName(name);
1
s.setName(name);
2
    ((EStructuralFeatureImpl)s).setContainerClass(containerClass);
2
    ((EStructuralFeatureImpl)s).setContainerClass(containerClass);
3
    s.setTransient(isTransient);
3
    s.setTransient(isTransient);
4
    s.setVolatile(isVolatile);
4
    s.setVolatile(isVolatile);
5
    s.setChangeable(isChangeable);
5
    s.setChangeable(isChangeable);
6
    s.setUnsettable(isUnsettable);
6
    s.setUnsettable(isUnsettable);
7
    s.setUnique(isUnique);
7
    s.setUnique(isUnique);
8
    s.setDerived(isDerived);
8
    s.setDerived(isDerived);
9
    s.setOrdered(isOrdered);
9
    s.setOrdered(isOrdered);
10
    s.setLowerBound(lowerBound);
10
    s.setLowerBound(lowerBound);
11
    s.setUpperBound(upperBound);
11
    s.setUpperBound(upperBound);
12
    s.setEGenericType(type);
12
    s.setEType(type);
13
    if (defaultValue != null)
13
    if (defaultValue != null)
14
    {
14
    {
15
      s.setDefaultValueLiteral(defaultValue);
15
      s.setDefaultValueLiteral(defaultValue);
16
    }
16
    }
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 comparisons148
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements14
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)10.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    s.setName(name);
    1
    s.setName(name);
    2
    ((EStructuralFeatureImpl)s).setContainerClass(containerClass);
    2
    ((EStructuralFeatureImpl)s).setContainerClass(containerClass);
    2
    ((EStructuralFeatureImpl)s).setContainerClass(containerClass);
    Differences
    Expression1Expression2Difference
    java.lang.Class<>java.lang.Class<>VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.lang.Class<> of variable containerClass does not match with type java.lang.Class<> of variable containerClass
    • Make classes java.lang.Class<> and java.lang.Class<> extend a common superclass
    2
    ((EStructuralFeatureImpl)s).setContainerClass(containerClass);
    3
    s.setTransient(isTransient);
    3
    s.setTransient(isTransient);
    4
    s.setVolatile(isVolatile);
    4
    s.setVolatile(isVolatile);
    5
    s.setChangeable(isChangeable);
    5
    s.setChangeable(isChangeable);
    6
    s.setUnsettable(isUnsettable);
    6
    s.setUnsettable(isUnsettable);
    7
    s.setUnique(isUnique);
    7
    s.setUnique(isUnique);
    8
    s.setDerived(isDerived);
    8
    s.setDerived(isDerived);
    9
    s.setOrdered(isOrdered);
    9
    s.setOrdered(isOrdered);
    10
    s.setLowerBound(lowerBound);
    10
    s.setLowerBound(lowerBound);
    11
    s.setUpperBound(upperBound);
    11
    s.setUpperBound(upperBound);
    12
    s.setEGenericType(type);
    12
    s.setEGenericType(type);
    12
    s.setEType(type);
    Differences
    Expression1Expression2Difference
    setEGenericTypesetETypeMETHOD_INVOCATION_NAME_MISMATCH
    org.eclipse.emf.ecore.EGenericTypeorg.eclipse.emf.ecore.EClassifierVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression s.setEGenericType(type) is a void method call, and thus it cannot be parameterized
    Expression s.setEType(type) is a void method call, and thus it cannot be parameterized
    Type org.eclipse.emf.ecore.EGenericType of variable type does not match with type org.eclipse.emf.ecore.EClassifier of variable type
    • Make classes org.eclipse.emf.ecore.EGenericType and org.eclipse.emf.ecore.EClassifier extend a common superclass
    12
    s.setEType(type);
    13
    if (defaultValue != null)
    13
    if (defaultValue != null)
    14
    s.setDefaultValueLiteral(defaultValue);
    14
    s.setDefaultValueLiteral(defaultValue);
    Precondition Violations (4)
    Row Violation
    1Type java.lang.Class<> of variable containerClass does not match with type java.lang.Class<> of variable containerClass
    2Expression s.setEGenericType(type) is a void method call, and thus it cannot be parameterized
    3Expression s.setEType(type) is a void method call, and thus it cannot be parameterized
    4Type org.eclipse.emf.ecore.EGenericType of variable type does not match with type org.eclipse.emf.ecore.EClassifier of variable type