11396-2-11

boolean oldOrdered = (eFlags & ORDERED_EFLAG) != 0; if (newOrdered) eFlags |= ORDERED_EFLAG; else eFlags &= ~ORDERED_EFLAG; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, EcorePackage.ETYPED_ELEMENT__ORDERED, oldOrdered, newOrdered));
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));

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

1

    boolean oldOrdered = (eFlags & ORDERED_EFLAG) != 0;↵

1

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

2

        if (newOrdered) eFlags |= ORDERED_EFLAG; else eFlags &= ~ORDERED_EFLAG;↵

2

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

3

        if (eNotificationRequired())↵

3

        if (eNotificationRequired())↵

4

          eNotify(new ENotificationImpl(this, Notification.SET, EcorePackage.ETYPED_ELEMENT__ORDERED, oldOrdered, newOrdered));

4

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

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.3
   Clone type | Type 2

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

   1

       boolean oldOrdered = (eFlags & ORDERED_EFLAG) != 0;

   1 | boolean oldOrdered = (eFlags & ORDERED_EFLAG) != 0;
   1 | boolean oldInterface = (eFlags & INTERFACE_EFLAG) != 0;

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   oldOrdered | oldInterface | VARIABLE_NAME_MISMATCH
   ORDERED_EFLAG | INTERFACE_EFLAG | VARIABLE_NAME_MISMATCH

   1

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

   2

       if (newOrdered)

   2 | if (newOrdered)
   2 | if (newInterface)

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

   2

       if (newInterface)

   3

       eFlags |= ORDERED_EFLAG;

   3 | eFlags |= ORDERED_EFLAG;
   3 | eFlags |= INTERFACE_EFLAG;

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

   3

       eFlags |= INTERFACE_EFLAG;

       else

       else

   4

       eFlags &= ~ORDERED_EFLAG;

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

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

   4

       eFlags &= ~INTERFACE_EFLAG;

   5

       if (eNotificationRequired())

   5

       if (eNotificationRequired())

   6

       eNotify(new ENotificationImpl(this, Notification.SET, EcorePackage.ETYPED_ELEMENT__ORDERED, oldOrdered, newOrdered));

   6 | eNotify(new ENotificationImpl(this, Notification.SET, EcorePackage.ETYPED_ELEMENT__ORDERED, oldOrdered, newOrdered));
   6 | eNotify(new ENotificationImpl(this, Notification.SET, EcorePackage.ECLASS__INTERFACE, oldInterface, newInterface));

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   ETYPED_ELEMENT__ORDERED | ECLASS__INTERFACE | VARIABLE_NAME_MISMATCH
   oldOrdered | oldInterface | VARIABLE_NAME_MISMATCH
   newOrdered | newInterface | VARIABLE_NAME_MISMATCH

   6

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

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