10367-1-2

case EcorePackage.EREFERENCE__DERIVED: setDerived(DERIVED_EDEFAULT); return; case EcorePackage.EREFERENCE__CONTAINMENT: setContainment(CONTAINMENT_EDEFAULT); return; case EcorePackage.EREFERENCE__RESOLVE_PROXIES: setResolveProxies(RESOLVE_PROXIES_EDEFAULT); return; case EcorePackage.EREFERENCE__EOPPOSITE: setEOpposite((EReference)null); return; case EcorePackage.EREFERENCE__EKEYS: getEKeys().clear(); return;
case EcorePackage.EPACKAGE__NAME: setName(NAME_EDEFAULT); return; case EcorePackage.EPACKAGE__NS_URI: setNsURI(NS_URI_EDEFAULT); return; case EcorePackage.EPACKAGE__NS_PREFIX: setNsPrefix(NS_PREFIX_EDEFAULT); return; case EcorePackage.EPACKAGE__EFACTORY_INSTANCE: setEFactoryInstance((EFactory)null); return; case EcorePackage.EPACKAGE__ECLASSIFIERS: getEClassifiers().clear(); return;

Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/impl/EReferenceImpl.java |  | File path: /emf-2.4.1/src/org/eclipse/emf/ecore/impl/EPackageImpl.java
Method name: `void eUnset(int)` |  | Method name: `void eUnset(int)`
Number of AST nodes: 15 |  | Number of AST nodes: 15

1

    case EcorePackage.EREFERENCE__DERIVED:↵

1

    case EcorePackage.E↵

2

            setDerived(DERIVED↵

2

    PACKAGE__NAME:↵

3

    _EDEFAULT);↵

3

            setName(NAME_EDEFAULT);↵

4

            return;↵

4

            return;↵

5

          case EcorePackage.EREFERENCE__CONTAINMENT:↵

5

          case EcorePackage.E↵

6

            setContainment(CONTAINMENT↵

6

    PACKAGE__NS_URI:↵

7

    _EDEFAULT);↵

7

            setNsURI(NS_URI_EDEFAULT);↵

8

            return;↵

8

            return;↵

9

          case EcorePackage.EREFERENCE__RESOLVE_PROXIES:↵

9

          case EcorePackage.E↵

10

            setResolveProxies(RESOLVE_PROXIES↵

10

    PACKAGE__NS_PREFIX:↵

11

    _EDEFAULT);↵

11

            setNsPrefix(NS_PREFIX_EDEFAULT);↵

12

            return;↵

12

            return;↵

13

          case EcorePackage.EREFERENCE__EOPPOSITE:↵

13

          case EcorePackage.E↵

14

            setEOpposite((EReference↵

14

    PACKAGE__EFACTORY_INSTANCE:↵

15

    )null);↵

15

            setEFactoryInstance((EFactory)null);↵

16

            return;↵

16

            return;↵

17

          case EcorePackage.EREFERENCE__EKEYS:↵

17

          case EcorePackage.EPACKAGE__ECLASSIFIERS:↵

18

            getEKeys().clear();↵

18

            getEClassifiers().clear();↵

19

            return;

19

            return;

See real code fragment |  | See real code fragment

Summary
Number of common nesting structure subtrees | 1
Number of refactorable cases | 0
Number of non-refactorable cases | 1
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.0
Clones location | Clones are in different classes having the same super class
Number of node comparisons | 138

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 13
   Number of unmapped statements in the first code fragment | 2
   Number of unmapped statements in the second code fragment | 2
   Time elapsed for statement mapping (ms) | 0.0
   Clone type | Type 2

   Mapped Statements
   ID | Statement |  | ID | Statement
   --- | --- | --- | --- | ---

   9

       setNsURI(NS_URI_EDEFAULT);

   12

       setNsPrefix(NS_PREFIX_EDEFAULT);

   41

       case EcorePackage.EREFERENCE__DERIVED:

   41 | case EcorePackage.EREFERENCE__DERIVED:
   17 | case EcorePackage.EPACKAGE__ECLASSIFIERS:

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   EREFERENCE__DERIVED | EPACKAGE__ECLASSIFIERS | VARIABLE_NAME_MISMATCH

   17

       case EcorePackage.EPACKAGE__ECLASSIFIERS:

   42

       setDerived(DERIVED_EDEFAULT);

   42 | setDerived(DERIVED_EDEFAULT);
   18 | getEClassifiers().clear();

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   setDerived | clear | METHOD_INVOCATION_NAME_MISMATCH
   setDerived(DERIVED_EDEFAULT) | getEClassifiers().clear() | ARGUMENT_NUMBER_MISMATCH
   | getEClassifiers() | MISSING_METHOD_INVOCATION_EXPRESSION

   Preondition Violations
   Expression setDerived(DERIVED_EDEFAULT) is a void method call, and thus it cannot be parameterized
   Expression getEClassifiers().clear() is a void method call, and thus it cannot be parameterized
   Expression setDerived(DERIVED_EDEFAULT) is a void method call, and thus it cannot be parameterized
   Expression getEClassifiers().clear() is a void method call, and thus it cannot be parameterized

   18

       getEClassifiers().clear();

   43

       return;

   43 | return;
   19 | return;

   Preondition Violations
   Conditional return;
   Conditional return;

   19

       return;

   44

       case EcorePackage.EREFERENCE__CONTAINMENT:

   44 | case EcorePackage.EREFERENCE__CONTAINMENT:
   14 | case EcorePackage.EPACKAGE__EFACTORY_INSTANCE:

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   EREFERENCE__CONTAINMENT | EPACKAGE__EFACTORY_INSTANCE | VARIABLE_NAME_MISMATCH

   14

       case EcorePackage.EPACKAGE__EFACTORY_INSTANCE:

   45

       setContainment(CONTAINMENT_EDEFAULT);

   46

       return;

   46 | return;
   16 | return;

   Preondition Violations
   Conditional return;
   Conditional return;

   16

       return;

   47

       case EcorePackage.EREFERENCE__RESOLVE_PROXIES:

   47 | case EcorePackage.EREFERENCE__RESOLVE_PROXIES:
   11 | case EcorePackage.EPACKAGE__NS_PREFIX:

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   EREFERENCE__RESOLVE_PROXIES | EPACKAGE__NS_PREFIX | VARIABLE_NAME_MISMATCH

   11

       case EcorePackage.EPACKAGE__NS_PREFIX:

   48

       setResolveProxies(RESOLVE_PROXIES_EDEFAULT);

   49

       return;

   49 | return;
   13 | return;

   Preondition Violations
   Conditional return;
   Conditional return;

   13

       return;

   50

       case EcorePackage.EREFERENCE__EOPPOSITE:

   50 | case EcorePackage.EREFERENCE__EOPPOSITE:
   8 | case EcorePackage.EPACKAGE__NS_URI:

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   EREFERENCE__EOPPOSITE | EPACKAGE__NS_URI | VARIABLE_NAME_MISMATCH

   8

       case EcorePackage.EPACKAGE__NS_URI:

   51

       setEOpposite((EReference)null);

   51 | setEOpposite((EReference)null);
   15 | setEFactoryInstance((EFactory)null);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   setEOpposite | setEFactoryInstance | METHOD_INVOCATION_NAME_MISMATCH
   org.eclipse.emf.ecore.EReference | org.eclipse.emf.ecore.EFactory | VARIABLE_TYPE_MISMATCH

   Preondition Violations
   Expression setEOpposite((EReference)null) is a void method call, and thus it cannot be parameterized
   Expression setEFactoryInstance((EFactory)null) is a void method call, and thus it cannot be parameterized

   Type org.eclipse.emf.ecore.EReference of variable (EReference)null does not match with type org.eclipse.emf.ecore.EFactory of variable (EFactory)null
   - Make classes org.eclipse.emf.ecore.EReference and org.eclipse.emf.ecore.EFactory extend a common superclass

   15

       setEFactoryInstance((EFactory)null);

   52

       return;

   52 | return;
   10 | return;

   Preondition Violations
   Conditional return;
   Conditional return;

   10

       return;

   53

       case EcorePackage.EREFERENCE__EKEYS:

   53 | case EcorePackage.EREFERENCE__EKEYS:
   5 | case EcorePackage.EPACKAGE__NAME:

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   EREFERENCE__EKEYS | EPACKAGE__NAME | VARIABLE_NAME_MISMATCH

   5

       case EcorePackage.EPACKAGE__NAME:

   54

       getEKeys().clear();

   54 | getEKeys().clear();
   6 | setName(NAME_EDEFAULT);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   clear | setName | METHOD_INVOCATION_NAME_MISMATCH
   getEKeys().clear() | setName(NAME_EDEFAULT) | ARGUMENT_NUMBER_MISMATCH
   getEKeys() |  | MISSING_METHOD_INVOCATION_EXPRESSION

   Preondition Violations
   Expression getEKeys().clear() is a void method call, and thus it cannot be parameterized
   Expression setName(NAME_EDEFAULT) is a void method call, and thus it cannot be parameterized
   Expression getEKeys().clear() is a void method call, and thus it cannot be parameterized
   Expression setName(NAME_EDEFAULT) is a void method call, and thus it cannot be parameterized

   6

       setName(NAME_EDEFAULT);

   55

       return;

   55 | return;
   7 | return;

   Preondition Violations
   Conditional return;
   Conditional return;

   7

       return;

   Precondition Violations (21)
   Row | Violation
   --- | ---
   1 | Expression setDerived(DERIVED_EDEFAULT) is a void method call, and thus it cannot be parameterized
   2 | Expression getEClassifiers().clear() is a void method call, and thus it cannot be parameterized
   3 | Expression setDerived(DERIVED_EDEFAULT) is a void method call, and thus it cannot be parameterized
   4 | Expression getEClassifiers().clear() is a void method call, and thus it cannot be parameterized
   5 | Conditional return;
   6 | Conditional return;
   7 | Conditional return;
   8 | Conditional return;
   9 | Conditional return;
   10 | Conditional return;
   11 | Expression setEOpposite((EReference)null) is a void method call, and thus it cannot be parameterized
   12 | Expression setEFactoryInstance((EFactory)null) is a void method call, and thus it cannot be parameterized
   13 | Type org.eclipse.emf.ecore.EReference of variable (EReference)null does not match with type org.eclipse.emf.ecore.EFactory of variable (EFactory)null
   14 | Conditional return;
   15 | Conditional return;
   16 | Expression getEKeys().clear() is a void method call, and thus it cannot be parameterized
   17 | Expression setName(NAME_EDEFAULT) is a void method call, and thus it cannot be parameterized
   18 | Expression getEKeys().clear() is a void method call, and thus it cannot be parameterized
   19 | Expression setName(NAME_EDEFAULT) is a void method call, and thus it cannot be parameterized
   20 | Conditional return;
   21 | Conditional return;