11396-11-12

boolean oldInterface = (eFlags & INTERFACE_EFLAG) != 0; if (newInterface) eFlags |= INTERFACE_EFLAG; else eFlags &= ~INTERFACE_EFLAG; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, EcorePackage.ECLASS__INTERFACE, oldInterface, newInterface));
boolean oldResolveProxies = (eFlags & RESOLVE_PROXIES_EFLAG) != 0; if (newResolveProxies) eFlags |= RESOLVE_PROXIES_EFLAG; else eFlags &= ~RESOLVE_PROXIES_EFLAG; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, EcorePackage.EREFERENCE__RESOLVE_PROXIES, oldResolveProxies, newResolveProxies));

Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/impl/EClassImpl.java |  | File path: /emf-2.4.1/src/org/eclipse/emf/ecore/impl/EReferenceImpl.java
Method name: `void setInterface(boolean)` |  | Method name: `void setResolveProxies(boolean)`
Number of AST nodes: 6 |  | Number of AST nodes: 6

1

    boolean oldInterface = (eFlags & INTERFACE_EFLAG) != 0;↵

1

    boolean oldResolveProxies = (eFlags & RESOLVE_PROXIES_EFLAG) != 0;↵

2

        if (newInterface) eFlags |= INTERFACE_EFLAG; else eFlags &= ~INTERFACE_EFLAG;↵

2

        if (newResolveProxies) eFlags |= RESOLVE_PROXIES_EFLAG; else eFlags &= ~RESOLVE_PROXIES_EFLAG;↵

3

        if (eNotificationRequired())↵

3

        if (eNotificationRequired())↵

4

          eNotify(new ENotificationImpl(this, Notification.SET, EcorePackage.ECLASS__INTERFACE, oldInterface, newInterface));

4

          eNotify(new ENotificationImpl(this, Notification.SET, EcorePackage.EREFERENCE__RESOLVE_PROXIES, oldResolveProxies, newResolveProxies));

See real code fragment |  | See real code fragment

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

1. {Refactorable}

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

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

   1

       boolean oldInterface = (eFlags & INTERFACE_EFLAG) != 0;

   1 | boolean oldInterface = (eFlags & INTERFACE_EFLAG) != 0;
   1 | boolean oldResolveProxies = (eFlags & RESOLVE_PROXIES_EFLAG) != 0;

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   oldInterface | oldResolveProxies | VARIABLE_NAME_MISMATCH
   INTERFACE_EFLAG | RESOLVE_PROXIES_EFLAG | VARIABLE_NAME_MISMATCH

   1

       boolean oldResolveProxies = (eFlags & RESOLVE_PROXIES_EFLAG) != 0;

   2

       if (newInterface)

   2 | if (newInterface)
   2 | if (newResolveProxies)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   newInterface | newResolveProxies | VARIABLE_NAME_MISMATCH

   2

       if (newResolveProxies)

   3

       eFlags |= INTERFACE_EFLAG;

   3 | eFlags |= INTERFACE_EFLAG;
   3 | eFlags |= RESOLVE_PROXIES_EFLAG;

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   INTERFACE_EFLAG | RESOLVE_PROXIES_EFLAG | VARIABLE_NAME_MISMATCH

   3

       eFlags |= RESOLVE_PROXIES_EFLAG;

       else

       else

   4

       eFlags &= ~INTERFACE_EFLAG;

   4 | eFlags &= ~INTERFACE_EFLAG;
   4 | eFlags &= ~RESOLVE_PROXIES_EFLAG;

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   INTERFACE_EFLAG | RESOLVE_PROXIES_EFLAG | VARIABLE_NAME_MISMATCH

   4

       eFlags &= ~RESOLVE_PROXIES_EFLAG;

   5

       if (eNotificationRequired())

   5

       if (eNotificationRequired())

   6

       eNotify(new ENotificationImpl(this, Notification.SET, EcorePackage.ECLASS__INTERFACE, oldInterface, newInterface));

   6 | eNotify(new ENotificationImpl(this, Notification.SET, EcorePackage.ECLASS__INTERFACE, oldInterface, newInterface));
   6 | eNotify(new ENotificationImpl(this, Notification.SET, EcorePackage.EREFERENCE__RESOLVE_PROXIES, oldResolveProxies, newResolveProxies));

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   ECLASS__INTERFACE | EREFERENCE__RESOLVE_PROXIES | VARIABLE_NAME_MISMATCH
   oldInterface | oldResolveProxies | VARIABLE_NAME_MISMATCH
   newInterface | newResolveProxies | VARIABLE_NAME_MISMATCH

   6

       eNotify(new ENotificationImpl(this, Notification.SET, EcorePackage.EREFERENCE__RESOLVE_PROXIES, oldResolveProxies, newResolveProxies));

   Precondition Violations (0)
   Row | Violation
   --- | ---